fix(shared): handle banned/deactivated 403 as unauthenticated#8649
fix(shared): handle banned/deactivated 403 as unauthenticated#8649jacekradko wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: ceacf3b The changes in this PR will be included in the next version bump. This PR includes changesets to release 20 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📝 WalkthroughWalkthroughThis PR refines unauthenticated error detection by updating the Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
#8004 narrowed ClerkJS token/session sign-out from any 4xx to
isUnauthenticatedError, but that helper only matched 401 and 422. Terminal 403s (user_banned,user_deactivated) stopped triggering sign-out.This adds those two codes into the predicate. Generic 403 and 429 stay out of the sign-out path on purpose.
Cross-checked against
clerk_go:apierror.UserBanned()/UserDeactivated()returnhttp.StatusForbiddenwith codesuser_banned/user_deactivated, serialized as{ errors: [{ code, ... }] }, and are emitted on the session-token / handshake path inapi/shared/sessions/service.go. So the predicate matches the API contract 1:1.Test additions cover both directions: terminal codes return true, other 403 codes (e.g.
not_allowed_access) still return false.