@absolutejs/auth 0.59.3 → 0.60.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
@@ -6109,6 +6109,9 @@ var credentialsEmailVerification = ({
6109
6109
  if (!consumed) {
6110
6110
  return status("Bad Request", "Invalid or expired verification token");
6111
6111
  }
6112
+ if (consumed.expiresAt < Date.now()) {
6113
+ return status("Bad Request", "Invalid or expired verification token");
6114
+ }
6112
6115
  await credentialStore.setEmailVerified(consumed.email);
6113
6116
  await onEmailVerified?.({ email: consumed.email });
6114
6117
  return status("OK", { status: "email_verified" });
@@ -6462,6 +6465,9 @@ var credentialsPasswordReset = ({
6462
6465
  if (!consumed) {
6463
6466
  return status("Bad Request", "Invalid or expired reset token");
6464
6467
  }
6468
+ if (consumed.expiresAt < Date.now()) {
6469
+ return status("Bad Request", "Invalid or expired reset token");
6470
+ }
6465
6471
  const policy = await evaluatePassword(password, passwordPolicy);
6466
6472
  if (!policy.ok) {
6467
6473
  return status("Bad Request", {
@@ -11499,7 +11505,7 @@ var callback = ({
11499
11505
  if (requiresPKCE && verifier === undefined) {
11500
11506
  return status("Bad Request", "Code verifier not found and is required");
11501
11507
  }
11502
- const originUrl = origin_url?.value ?? "/";
11508
+ const originUrl = toSafeLocalPath(origin_url?.value);
11503
11509
  let tokenResponse2;
11504
11510
  try {
11505
11511
  tokenResponse2 = await providerInstance.validateAuthorizationCode(requiresPKCE ? { code, codeVerifier: verifier } : { code });
@@ -38706,5 +38712,5 @@ export {
38706
38712
  VerificationProviderError
38707
38713
  };
38708
38714
 
38709
- //# debugId=D7D259888A27730164756E2164756E21
38715
+ //# debugId=F11B818E3AEEB74B64756E2164756E21
38710
38716
  //# sourceMappingURL=server.js.map