@rebasepro/server 0.9.1-canary.ff338b5 → 0.10.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/dist/init.d.ts CHANGED
@@ -300,7 +300,7 @@ export interface RebaseBackendConfig {
300
300
  * storageAuthorize: async ({ key, user, operation }) => {
301
301
  * if (!user) return false;
302
302
  * const [ownerId] = key.split("/");
303
- * return ownerId === user.userId || operation === "read";
303
+ * return ownerId === user.uid || operation === "read";
304
304
  * }
305
305
  * ```
306
306
  *
@@ -4218,10 +4218,10 @@ function configureJwt(config) {
4218
4218
  /**
4219
4219
  * Generate an access token (short-lived, 1 hour by default)
4220
4220
  */
4221
- function generateAccessToken(userId, roles, aal = "aal1", customClaims) {
4221
+ function generateAccessToken(uid, roles, aal = "aal1", customClaims) {
4222
4222
  if (!jwtConfig.secret) throw new Error("JWT secret not configured. Call configureJwt() first.");
4223
4223
  const payload = {
4224
- userId,
4224
+ uid,
4225
4225
  roles,
4226
4226
  aal,
4227
4227
  ...customClaims
@@ -4274,14 +4274,14 @@ function verifyAccessToken(token) {
4274
4274
  logger.error("[JWT] Verification failed: a purpose-scoped token is not an access token", { purpose: decoded.purpose });
4275
4275
  return null;
4276
4276
  }
4277
- const id = decoded.userId || decoded.uid || decoded.sub;
4277
+ const id = decoded.uid || decoded.userId || decoded.sub;
4278
4278
  if (!id) {
4279
4279
  logger.error("[JWT] Verification failed: missing id in payload", { detail: decoded });
4280
4280
  return null;
4281
4281
  }
4282
4282
  const aal = decoded.aal === "aal1" || decoded.aal === "aal2" ? decoded.aal : "aal1";
4283
4283
  return {
4284
- userId: id,
4284
+ uid: id,
4285
4285
  roles: decoded.roles || [],
4286
4286
  aal
4287
4287
  };
@@ -4365,4 +4365,4 @@ function verifyDownloadToken(token) {
4365
4365
  //#endregion
4366
4366
  export { getAccessTokenExpiry as a, jwt_exports as c, require_jsonwebtoken as d, __commonJSMin as f, __toESM as h, generateRefreshToken as i, verifyAccessToken as l, __require as m, generateAccessToken as n, getRefreshTokenExpiry as o, __exportAll as p, generateDownloadToken as r, hashRefreshToken as s, configureJwt as t, verifyDownloadToken as u };
4367
4367
 
4368
- //# sourceMappingURL=jwt-BJzQOa8a.js.map
4368
+ //# sourceMappingURL=jwt-B3zjddCa.js.map