@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/index.js +13 -2
- package/dist/index.js.map +5 -5
- package/dist/server.js +13 -2
- package/dist/server.js.map +5 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5333,6 +5333,8 @@ var evaluatePassword = async (password, policy = {}) => {
|
|
|
5333
5333
|
var isPasswordCompromised = (password) => isPasswordBreached(password);
|
|
5334
5334
|
|
|
5335
5335
|
// src/credentials/login.ts
|
|
5336
|
+
var dummyPasswordHashPromise;
|
|
5337
|
+
var dummyPasswordHash = () => dummyPasswordHashPromise ??= hashPassword("absolutejs-auth-timing-equalizer");
|
|
5336
5338
|
var credentialsLogin = ({
|
|
5337
5339
|
authSessionStore,
|
|
5338
5340
|
checkBreachesOnLogin,
|
|
@@ -5374,7 +5376,13 @@ var credentialsLogin = ({
|
|
|
5374
5376
|
const credential = await credentialStore.getCredentialByEmail(normalizedEmail);
|
|
5375
5377
|
const user = await getUserByEmail(normalizedEmail);
|
|
5376
5378
|
const verifyHash = passwordVerifier ?? verifyPassword;
|
|
5377
|
-
|
|
5379
|
+
let passwordValid;
|
|
5380
|
+
if (credential === undefined) {
|
|
5381
|
+
await verifyPassword(password, await dummyPasswordHash());
|
|
5382
|
+
passwordValid = false;
|
|
5383
|
+
} else {
|
|
5384
|
+
passwordValid = await verifyHash(password, credential.passwordHash);
|
|
5385
|
+
}
|
|
5378
5386
|
if (!credential || !user || credential.status !== "active" || !passwordValid) {
|
|
5379
5387
|
await lockoutGuard?.recordFailure(normalizedEmail);
|
|
5380
5388
|
await onCredentialsLoginError?.({
|
|
@@ -37323,6 +37331,9 @@ var buildAuthApplications = async (configuration) => {
|
|
|
37323
37331
|
await webhookDispatch?.(event);
|
|
37324
37332
|
}
|
|
37325
37333
|
}) : undefined;
|
|
37334
|
+
if (auditEmit === undefined) {
|
|
37335
|
+
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.");
|
|
37336
|
+
}
|
|
37326
37337
|
const lockoutGuard = lockout ? createLockoutGuard(lockout) : undefined;
|
|
37327
37338
|
const resolvedAgentAuth = agentAuth === undefined ? undefined : {
|
|
37328
37339
|
...agentAuth,
|
|
@@ -38046,5 +38057,5 @@ export {
|
|
|
38046
38057
|
AGENT_CLAIM_GRANT_TYPE
|
|
38047
38058
|
};
|
|
38048
38059
|
|
|
38049
|
-
//# debugId=
|
|
38060
|
+
//# debugId=60AF00D018199BB164756E2164756E21
|
|
38050
38061
|
//# sourceMappingURL=index.js.map
|