@supabase/auth-js 2.107.0-beta.1 → 2.107.0-canary.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supabase/auth-js",
3
- "version": "2.107.0-beta.1",
3
+ "version": "2.107.0-canary.1",
4
4
  "private": false,
5
5
  "description": "Official SDK for Supabase Auth",
6
6
  "keywords": [
@@ -3800,7 +3800,9 @@ export default class GoTrueClient {
3800
3800
  if (typeof this.detectSessionInUrl === 'function') {
3801
3801
  return this.detectSessionInUrl(new URL(window.location.href), params)
3802
3802
  }
3803
- return Boolean(params.access_token || params.error_description)
3803
+ return Boolean(
3804
+ params.access_token || params.error || params.error_description || params.error_code
3805
+ )
3804
3806
  }
3805
3807
 
3806
3808
  /**
@@ -6165,8 +6167,13 @@ export default class GoTrueClient {
6165
6167
  } = decodeJWT(token)
6166
6168
 
6167
6169
  if (!options?.allowExpired) {
6168
- // Reject expired JWTs should only happen if jwt argument was passed
6169
- validateExp(payload.exp)
6170
+ // Reject expired JWTs should only happen if jwt argument was passed.
6171
+ // Rethrow as AuthInvalidJwtError so the outer catch converts it to { data, error }.
6172
+ try {
6173
+ validateExp(payload.exp)
6174
+ } catch (e) {
6175
+ throw new AuthInvalidJwtError(e instanceof Error ? e.message : 'JWT validation failed')
6176
+ }
6170
6177
  }
6171
6178
 
6172
6179
  const signingKey =
@@ -4,4 +4,4 @@
4
4
  // - Debugging and support (identifying which version is running)
5
5
  // - Telemetry and logging (version reporting in errors/analytics)
6
6
  // - Ensuring build artifacts match the published package version
7
- export const version = '2.107.0-beta.1'
7
+ export const version = '2.107.0-canary.1'