@rebasepro/server 0.13.0 → 0.13.1-canary.gcd6689e

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.
@@ -4159,6 +4159,7 @@ var jwt_exports = /* @__PURE__ */ __exportAll({
4159
4159
  getRefreshTokenExpiry: () => getRefreshTokenExpiry,
4160
4160
  getRefreshTokenTtlMs: () => getRefreshTokenTtlMs,
4161
4161
  hashRefreshToken: () => hashRefreshToken,
4162
+ isJwtConfigured: () => isJwtConfigured,
4162
4163
  verifyAccessToken: () => verifyAccessToken,
4163
4164
  verifyDownloadToken: () => verifyDownloadToken
4164
4165
  });
@@ -4202,6 +4203,20 @@ function configureJwt(config) {
4202
4203
  };
4203
4204
  }
4204
4205
  /**
4206
+ * Has this server been given a JWT secret?
4207
+ *
4208
+ * False on every backend that authenticates through an adapter — Firebase,
4209
+ * Clerk, anything with its own tokens — because nothing calls
4210
+ * {@link configureJwt} there. Signing paths still throw when it is false, since
4211
+ * asking for a token from a server that cannot mint one is a mistake worth
4212
+ * hearing about. Paths whose contract is *"tolerate the absence of auth"* must
4213
+ * ask first: `optionalAuth` crashing a request because this backend does not do
4214
+ * JWT is a 500 on a route that had already decided anonymous was acceptable.
4215
+ */
4216
+ function isJwtConfigured() {
4217
+ return Boolean(jwtConfig.secret);
4218
+ }
4219
+ /**
4205
4220
  * Generate an access token (short-lived, 1 hour by default)
4206
4221
  */
4207
4222
  function generateAccessToken(uid, roles, aal = "aal1", customClaims) {
@@ -4359,6 +4374,6 @@ function verifyDownloadToken(token) {
4359
4374
  }
4360
4375
  }
4361
4376
  //#endregion
4362
- export { generateRefreshToken as a, getRefreshTokenTtlMs as c, verifyAccessToken as d, verifyDownloadToken as f, generateDownloadToken as i, hashRefreshToken as l, configureJwt as n, getAccessTokenExpiry as o, require_jsonwebtoken as p, generateAccessToken as r, getRefreshTokenExpiry as s, MAX_COOKIE_AGE_MS as t, jwt_exports as u };
4377
+ export { generateRefreshToken as a, getRefreshTokenTtlMs as c, jwt_exports as d, verifyAccessToken as f, generateDownloadToken as i, hashRefreshToken as l, require_jsonwebtoken as m, configureJwt as n, getAccessTokenExpiry as o, verifyDownloadToken as p, generateAccessToken as r, getRefreshTokenExpiry as s, MAX_COOKIE_AGE_MS as t, isJwtConfigured as u };
4363
4378
 
4364
- //# sourceMappingURL=jwt-DD6EtpGj.js.map
4379
+ //# sourceMappingURL=jwt-CzeviDcB.js.map