EndpointsAuth

Google OAuth authentication

Authenticates user using a Google OAuth2 authorization code from the popup auth-code flow

POST
/auth/google

Request Body

application/json
  1. body
code*string

Google OAuth2 authorization code from the popup auth-code flow

Response Body

Authentication successful

application/json
  1. response
accessToken*string

JWT access token for authentication

user*

Authenticated user

curl -X POST 'https://api.routess.com/auth/google' \  -H 'Content-Type: application/json' \  -d '{  "code": "4/0AX4XfWj..."}'
{  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",  "user": {    "id": 1,    "email": "[email protected]",    "name": "Jane Doe",    "handle": "jane-doe",    "avatar": "https://example.com/avatar.jpg",    "isEmailVerified": true,    "role": "user",    "preferences": {      "units": "km",      "showPois": true,      "terrain3d": false,      "autoSnap": true,      "defaultActivity": "Cycling",      "selectedSports": [        "cycle",        "run"      ],      "sportSpeeds": {        "run": 10,        "cycle": 25,        "walk": 5      },      "mapStyle": "outdoors",      "overlays": {        "heatmap": true,        "contour": false,        "bike": true,        "surface": false,        "wind": false,        "hikingNodes": false,        "cyclingNodes": false      },      "defaultRouteVisibility": "private",      "routingDefaults": {        "cycle": {          "surfacePreference": "mixed",          "avoidFerries": true,          "avoidHighways": true        },        "run": {          "surfacePreference": "mixed",          "avoidFerries": true,          "avoidHighways": true        },        "walk": {          "surfacePreference": "mixed",          "avoidFerries": true,          "avoidHighways": true        }      }    },    "idHash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",    "deletionStatus": "active",    "deletionRequestedAt": "2026-05-09T08:00:00.000Z",    "hasPassword": true  }}