cURL
curl --request GET \ --url http://localhost:2000/auth/signin/google/{code}
{ "token": "<string>", "user": { "_id": "<string>", "emails": "[email protected]", "role": "user" } }
Exchange Google OAuth authorization code for user profile and issue a session token. If the user does not exist, a new user is created.
{ "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "user": { "_id": "64b7f1a2e4b0a5d3f9c12345", "emails": "[email protected]", "role": "user" } }
{ "error": { "code": "VALIDATION_ERROR", "message": "Invalid authorization code" } }
{ "error": { "code": "SERVER_ERROR", "message": "Internal server error" } }
curl -X GET 'http://localhost:2000/auth/signin/google/4/0AX4XfWj...'
Authorization code returned by Google's OAuth flow
Successful sign-in, returns user and token
Show child attributes
Was this page helpful?