Skip to main content

Login/Register Google

GET /auth/google

Description

Starts the Google OAuth flow. This endpoint redirects the user to Google for authentication.

Request Parameters

Requires Authentication: false

No request body is required.

Usage Example

Open this URL in a browser:

https://api.daykeeper.app/auth/google

Callback

After Google authentication succeeds, the API handles the callback at:

/auth/google/callback

The callback returns:

{
"message": "Google login success",
"accessToken": "<jwt>",
"refreshToken": "<refresh_token>"
}

Notes

  • If the Google account does not exist yet, the API creates a new verified user automatically.
  • Existing users can be linked by matching email or google_id.
  • This is a browser redirect flow, not a JSON POST login route.

Error Response

CodeDescription
302/redirectRedirect to Google login
500Server error during OAuth flow