Repository navigation
feat(auth): wire up Authentik sign-in via Supabase custom OAuth provider - #30
Conversation
Supabase's custom_oauth_providers table already had a healthy Authentik integration configured, but the app never called signInWithOAuth and had no button for it — the provider was unreachable from the client. Add signInWithAuthentik() (authService.ts) and a "Continue with Authentik" button on the sign-in/sign-up screens, redirecting back through the current URL so any `?next=` survives the round trip. Claude-Session: https://claude.ai/code/session_015PrayZEbYqmTBCxQKWFLse
|
Claude finished @rghamilton3's task in 4m 2s —— View job Review: Authentik sign-in via Supabase custom OAuth provider
Note: I couldn't run Strengths
Findings1. 2. No design mockup covers this UI (low severity, process note) 3. Nothing else stood out — no security issues (auth still goes entirely through |
…edirect allow-list - Read `error`/`error_description` off the URL fragment on AuthForm mount, since a failed Authentik round trip (denied consent, unconfigured provider) has no onAuthStateChange event and previously landed the user back at sign-in with no explanation - Reset `busy` via `finally` in onAuthentikSignIn so a resolve without an actual navigation (blocked popup, bfcache restore) can't leave the form stuck disabled - Wildcard supabase/config.toml's additional_redirect_urls to the full path+query per Supabase's own docs (exact-match allow list) — redirectTo carries `?next=`, which the previous bare-origin entries would have silently dropped - Document the Authentik provider's out-of-repo provisioning dependency (auth.custom_oauth_providers, dashboard-only) in authService.ts and CLAUDE.md - Add tests for the re-entrancy guard, the busy-reset regression, stale-error clearing, and the new fragment-error handling Claude-Session: https://claude.ai/code/session_015PrayZEbYqmTBCxQKWFLse
Summary
signInWithAuthentik()tosrc/lib/auth/authService.ts, callingsupabase.auth.signInWithOAuthagainst thecustom:authentikprovider already configured in Supabase (auth.custom_oauth_providers)AuthForm.svelte(shown on sign-in/sign-up, not on password reset), passingwindow.location.hrefasredirectToso any?next=survives the OAuth round trip and the existing layout guard hands the user back to where they startedProvidertype hasn't caught up with Supabase's custom-OAuth-provider feature yet, so the provider id needs a'custom:authentik' as Providercast — confirmed correct against Supabase's own docs and the installed@supabase/auth-jstype defsTest plan
bun run checkbun run lintbun run test:unit -- --run(338/338 passing, including new coverage for the OAuth service call and the button's visibility/error states)Claude-Session: https://claude.ai/code/session_015PrayZEbYqmTBCxQKWFLse