Trip PIN: the market's rule and the rider's own choice
Built: 2026-11-03 (rider's own choice). Written for operators and for whoever maintains the code.
The driver cannot start a trip until they type the 4-digit PIN the rider reads out. Nobody gets into the wrong car, and nobody is picked up by a driver who is not the one assigned.
The market's rule
Admin → Markets → Safety:
- always: India's default;
- at night only, between two times;
- off.
A few wrong tries lock the PIN, and the rider can ask for a new one.
The rider's own choice (Mexico: Uber's PIN verification, DiDi's fixed PIN)
Rider app → Safety → Trip PIN:
- Ask for a PIN on every trip, whatever the market does. The switch is hidden where the market already asks every time.
- My own PIN (optional): the same four digits on every trip, so there is nothing new to read out. Obvious PINs (1234, 0000, 1111 …) are refused. Leave it empty for a new PIN on each trip.
A PIN is set on a ride when the market's rule or the rider asks for one. It is the rider's own PIN when they have set one, otherwise a random one. A reset during the trip gives a fresh random PIN, for when the rider thinks theirs was overheard. The PIN is erased with the account.
Code
backend/src/rides/ride-pin.ts:parseOwnPinandpinForRide;rides.service.ts:- booking;
ridePinPrefsandsetRidePinPrefs;
safety/rider-safety.controller.ts:GET/PUT /safety/ride-pin;- migration
1700000153000-RiderPinPrefs(users.ride_pin_always,users.ride_pin_own); - rider app: the Trip PIN card in
app/(app)/safety.tsx.
source: docs/trip-pin.md (ships identically in the product zip)