🛣️ OAuth routes
OAuth routes are SDK composers, not Express middleware. Provider drivers perform browser redirects; callback routes create a one-time login token and redirect the browser.
Inventory
| Route | Method / protocol | Path | Schema | Validators | Success status |
|---|---|---|---|---|---|
googleOAuthRoute | GET / HTTP | /auth/oauth/google | googleOauthSchema | None | Driver redirect |
googleOAuthCallbackRoute | GET / HTTP | /auth/oauth/google/callback | None | None | 302 redirect |
lineOAuthRoute | GET / HTTP | /auth/oauth/line | lineOauthSchema | None | Driver redirect |
lineOAuthCallbackRoute | GET / HTTP | /auth/oauth/line/callback | None | None | 302 redirect |
twitterOAuthRoute | GET / HTTP | /auth/oauth/twitter | twitterOauthSchema | None | Driver redirect |
twitterOAuthCallbackRoute | GET / HTTP | /auth/oauth/twitter/callback | None | None | 302 redirect |
Details
googleOAuthRoute
Implementation
Endpoint: GET /auth/oauth/google
Access: Public; validators: [].
Request: googleOauthSchema validates fp, purpose, redirectUrl, optional typeId, and an optional empty JSON object.
Pipeline: requestGoogleOAuth → orThrow.
Success: The injected googleOAuthDriver.request handles the provider redirect.
Failure: AuthenticationInvalidTokenError is mapped to 400.View complete source
googleOAuthCallbackRoute
Implementation
Endpoint: GET /auth/oauth/google/callback
Access: Public; validators: [].
Request: No composed schema. The route reads provider callback data and requestQuery.state directly.
Pipeline: authenticateGoogleOAuth → extractOAuthLoginState → signup-only checkEmailIsUniqueInIdentities → verifyGoogleOAuth → getLoginTokenTarget → getFingerprint → buildTokenVerification → generateOneTimeToken → storeOneTimeToken → generateRedirectURL → redirectTo → orThrow.
Success: redirectTo sends 302 to the decoded state redirect URL with onetimeToken appended.
Failure: Invalid token/input is 400, no identity is 404, and database failures are 500. A driver exception before a Result escapes to the service error handler.View complete source
lineOAuthRoute
Implementation
Endpoint: GET /auth/oauth/line
Access: Public; validators: [].
Request: lineOauthSchema validates fp, purpose, redirectUrl, optional typeId, and an optional empty JSON object.
Pipeline: requestLineOAuth → orThrow.
Success: The injected lineOAuthDriver.request handles the provider redirect.
Failure: orThrow([]) has no explicit source error mapping.View complete source
lineOAuthCallbackRoute
Implementation
Endpoint: GET /auth/oauth/line/callback
Access: Public; validators: [].
Request: No composed schema; reads provider callback data and requestQuery.state.
Pipeline: authenticateLineOAuth → extractOAuthLoginState → verifyLineOAuth → getLoginTokenTarget → getFingerprint → buildTokenVerification → generateOneTimeToken → storeOneTimeToken → generateRedirectURL → redirectTo → orThrow.
Success: 302 redirect with the generated onetimeToken.
Failure: Input 400, missing identity 404, database or OAuth error 500; a thrown driver callback bypasses its Result wrapper.View complete source
twitterOAuthRoute
Implementation
Endpoint: GET /auth/oauth/twitter
Access: Public; validators: [].
Request: twitterOauthSchema validates purpose, redirectUrl, optional typeId, and an optional empty JSON object.
Pipeline: prepareTwitterCallbackState → requestTwitterOAuth → orThrow.
Success: The injected twitterOAuthDriver.request handles the provider redirect.
Failure: orThrow([]) has no explicit source error mapping.View complete source
twitterOAuthCallbackRoute
Implementation
Endpoint: GET /auth/oauth/twitter/callback
Access: Public; validators: [].
Request: No composed schema; Twitter's driver supplies callback state.
Pipeline: authenticateTwitterOAuth → verifyTwitterOAuth → getLoginTokenTarget → getFingerprint → buildTokenVerification → generateOneTimeToken → storeOneTimeToken → generateRedirectURL → redirectTo → orThrow.
Success: 302 redirect with the generated onetimeToken.
Failure: Input 400, missing identity 404, database/OAuth failure 500.View complete source