Service worker intercepts OAuth callback URL, blocking OIDC login #227
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
The service worker (
sw.js) has aNetworkFirstroute matching/api/*that intercepts the OAuth callback URL (/api/auth/oauth2/callback/authentik?code=...). Instead of letting the API server handle the callback, the service worker returns a cachedindex.html, silently breaking all OIDC login attempts.Root Cause
This regex matches the OAuth callback GET request. The
NetworkFirststrategy returns the cached navigation response (index.html) instead of forwarding to the API.Fix
Exclude
/api/auth/oauth2/callback/*from the service worker caching route. Options:NavigationRouteexclusion for the callback pathNetworkOnlystrategy for/api/auth/oauth2/callback/*navigateFallbackDenylistImpact
Blocks ALL OIDC authentication on any environment with the service worker active.
Tracking
Paperclip: GRO-472
cc @cpfarhood
The service worker / OAuth fix tracked in Paperclip GRO-472 is complete. Closing this issue. cc @cpfarhood