Skip to content

Commit e78d954

Browse files
authored
Bugfix: Cloud: be more specific about session error codes (#6051)
InvalidClientTokenError indicates an unrecoverable state for the session, so we need to be more exact about triggering it. A recent Clerk outage resulted in a lot of 429 responses which should really cause inactive-session, not a full clear to logged-out.
1 parent df6c57d commit e78d954

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/cloud/src/auth/WebAuthService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ export class WebAuthService extends EventEmitter<AuthServiceEvents> implements A
494494
signal: AbortSignal.timeout(10000),
495495
})
496496

497-
if (response.status >= 400 && response.status < 500) {
497+
if (response.status === 401 || response.status === 404) {
498498
throw new InvalidClientTokenError()
499499
} else if (!response.ok) {
500500
throw new Error(`HTTP ${response.status}: ${response.statusText}`)

0 commit comments

Comments
 (0)