@absolutejs/auth 0.60.0 → 0.61.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/server.js CHANGED
@@ -6329,6 +6329,8 @@ var evaluatePassword = async (password, policy = {}) => {
6329
6329
  var isPasswordCompromised = (password) => isPasswordBreached(password);
6330
6330
 
6331
6331
  // src/credentials/login.ts
6332
+ var dummyPasswordHashPromise;
6333
+ var dummyPasswordHash = () => dummyPasswordHashPromise ??= hashPassword("absolutejs-auth-timing-equalizer");
6332
6334
  var credentialsLogin = ({
6333
6335
  authSessionStore,
6334
6336
  checkBreachesOnLogin,
@@ -6370,7 +6372,13 @@ var credentialsLogin = ({
6370
6372
  const credential = await credentialStore.getCredentialByEmail(normalizedEmail);
6371
6373
  const user = await getUserByEmail(normalizedEmail);
6372
6374
  const verifyHash = passwordVerifier ?? verifyPassword;
6373
- const passwordValid = credential === undefined ? false : await verifyHash(password, credential.passwordHash);
6375
+ let passwordValid;
6376
+ if (credential === undefined) {
6377
+ await verifyPassword(password, await dummyPasswordHash());
6378
+ passwordValid = false;
6379
+ } else {
6380
+ passwordValid = await verifyHash(password, credential.passwordHash);
6381
+ }
6374
6382
  if (!credential || !user || credential.status !== "active" || !passwordValid) {
6375
6383
  await lockoutGuard?.recordFailure(normalizedEmail);
6376
6384
  await onCredentialsLoginError?.({
@@ -38319,6 +38327,9 @@ var buildAuthApplications = async (configuration) => {
38319
38327
  await webhookDispatch?.(event);
38320
38328
  }
38321
38329
  }) : undefined;
38330
+ if (auditEmit === undefined) {
38331
+ console.warn("[@absolutejs/auth] No audit sink configured (pass `audit` or `webhooks`). " + "Privileged flows (impersonation, role/permission changes, sign-out) will " + "run WITHOUT an audit trail.");
38332
+ }
38322
38333
  const lockoutGuard = lockout ? createLockoutGuard(lockout) : undefined;
38323
38334
  const resolvedAgentAuth = agentAuth === undefined ? undefined : {
38324
38335
  ...agentAuth,
@@ -38712,5 +38723,5 @@ export {
38712
38723
  VerificationProviderError
38713
38724
  };
38714
38725
 
38715
- //# debugId=F11B818E3AEEB74B64756E2164756E21
38726
+ //# debugId=D218332195145BB664756E2164756E21
38716
38727
  //# sourceMappingURL=server.js.map