@aurabase/auth 0.5.3 → 0.6.0

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/README.md CHANGED
@@ -192,7 +192,8 @@ await aura.auth.promoteAnonymous({ email: 'user@example.com', password: 'correct
192
192
  const { data: user } = await aura.auth.getUser()
193
193
 
194
194
  // Vérification locale JWKS (RS256/ES256) avec fallback getUser() (HS256 / JWKS vide).
195
- const { data: claims } = await aura.auth.getClaims()
195
+ const { data } = await aura.auth.getClaims()
196
+ console.log(data?.claims.sub, data?.header.alg)
196
197
 
197
198
  await aura.auth.updateUser({ data: { display_name: 'Ada' } })
198
199
 
package/dist/index.cjs CHANGED
@@ -1132,7 +1132,7 @@ var AuthService = class extends core.BaseService {
1132
1132
  })
1133
1133
  };
1134
1134
  }
1135
- return { data: { claims, header: r.header }, error: null };
1135
+ return { data: { ...claims, claims, header: r.header }, error: null };
1136
1136
  }
1137
1137
  if (r.code === "unsupported_alg" || r.code === "no_matching_key" || r.code === "jwks_fetch_failed") {
1138
1138
  let localPayload = {};
@@ -1160,11 +1160,11 @@ var AuthService = class extends core.BaseService {
1160
1160
  realAlg = decodeJwt(token).header.alg ?? "unknown";
1161
1161
  } catch {
1162
1162
  }
1163
+ const claims = { ...u.data, sub: u.data.id };
1163
1164
  return {
1164
1165
  data: {
1165
- // Claims dérivées de getUser : PAS de `exp`/`iat` (voir JwtClaims/JSDoc).
1166
- // `exp`/`iat` étant optionnels, plus de `as unknown as` masquant l'absence.
1167
- claims: { ...u.data, sub: u.data.id },
1166
+ ...claims,
1167
+ claims,
1168
1168
  header: { alg: realAlg }
1169
1169
  },
1170
1170
  error: null
package/dist/index.js CHANGED
@@ -1130,7 +1130,7 @@ var AuthService = class extends BaseService {
1130
1130
  })
1131
1131
  };
1132
1132
  }
1133
- return { data: { claims, header: r.header }, error: null };
1133
+ return { data: { ...claims, claims, header: r.header }, error: null };
1134
1134
  }
1135
1135
  if (r.code === "unsupported_alg" || r.code === "no_matching_key" || r.code === "jwks_fetch_failed") {
1136
1136
  let localPayload = {};
@@ -1158,11 +1158,11 @@ var AuthService = class extends BaseService {
1158
1158
  realAlg = decodeJwt(token).header.alg ?? "unknown";
1159
1159
  } catch {
1160
1160
  }
1161
+ const claims = { ...u.data, sub: u.data.id };
1161
1162
  return {
1162
1163
  data: {
1163
- // Claims dérivées de getUser : PAS de `exp`/`iat` (voir JwtClaims/JSDoc).
1164
- // `exp`/`iat` étant optionnels, plus de `as unknown as` masquant l'absence.
1165
- claims: { ...u.data, sub: u.data.id },
1164
+ ...claims,
1165
+ claims,
1166
1166
  header: { alg: realAlg }
1167
1167
  },
1168
1168
  error: null
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurabase/auth",
3
- "version": "0.5.3",
3
+ "version": "0.6.0",
4
4
  "description": "Service d'authentification du SDK Aurabase (sessions, OAuth/PKCE, MFA, magic link, OTP, admin)",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -46,7 +46,7 @@
46
46
  "authentication"
47
47
  ],
48
48
  "dependencies": {
49
- "@aurabase/core": "0.5.3"
49
+ "@aurabase/core": "0.6.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/node": "20.14.15",