Would this login pair get flagged?
Pick where someone logged in, then where the same account logged in again. This runs the exact logic from impossible-travel-guard, right in your browser, nothing sent anywhere.
First login, city
Second login, city
Check this login pair
This is the same math that ships in the open source library: haversine distance between the two points, divided by elapsed time, flagged above 1000 km/h (comfortably past commercial flight speed), ignored below 50 km (same metro area jitter). Wire it into a real login flow with npm install impossible-travel-guard.
import { TravelGuard } from "impossible-travel-guard";
const guard = new TravelGuard();
const result = await guard.check({ userId, latitude, longitude, timestamp: Date.now() });
if (result.flagged) { /* ask for MFA, don't hard-block */ }
Source and docs: github.com/Furqan-Ashraf/impossible-travel-guard . Need the latitude/longitude for a real IP instead of a demo city? IPGeolocation.io's IP location API has a free tier that returns it.