feat: Add server-backed Google One Tap - #473
Conversation
Posting Google's credential to the application server keeps bearer tokens out of browser JavaScript and lets AuthKit persist sessions through its existing encrypted cookie path. Hosted AuthKit remains the safe fallback when another authentication step is required.
Greptile SummaryAdds a server-backed Google One Tap flow that validates Google’s CSRF token, exchanges the ID token through WorkOS, saves the encrypted AuthKit session, and falls back to Hosted AuthKit when necessary.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; the previously reported proxy redirect issue is addressed by the new validated Important Files Changed
|
SDK PR ReviewFindings🔴 [CRITICAL] Hosted AuthKit fallback is broken end-to-end — PKCE cookie never setFile: The catch block calls Suggestion: const { url, sealedState } = await getAuthorizationUrl({ returnPathname });
await setPKCECookie(sealedState);
return noStore(redirectWithFallback(url));Add a test asserting the PKCE cookie is set on the fallback response. 🟠 [HIGH] Ships against an unpublished
|
Fallbacks redirected without verifier state, so their callbacks always failed. They also used a 307 after Google's credential POST, which could resubmit bearer form data. Preserve PKCE state and use a 303 while making unsupported SDK and authentication errors visible.
|
TARS addressed the actionable findings in Fixed
Remaining blockerThe PR body now explicitly blocks merge until Validation
PR remains open and review-required; it has not been merged. |
|
TARS confirms this finding was valid and is already fixed in
Greptile reviewed the previous head, |
Summary
GoogleOneTappresentation component that configures Google Identity Services for a server POST.handleGoogleOneTapto validate Google's double-submit CSRF token, exchange the credential server-side, and persist the standard encrypted AuthKit session.Dependencies
@workos-inc/node10.12 or newer, then bump this repository's dev dependency and replace the temporary typed compatibility guard with the published SDK method.Requested by mg@workos.com via TARS