@absolutejs/auth 0.65.0 → 0.65.2

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
@@ -6543,6 +6543,7 @@ var credentialsRegister = ({
6543
6543
  cookieSecure,
6544
6544
  credentialStore,
6545
6545
  enforceTrustedOrigins,
6546
+ getUserByEmail,
6546
6547
  onCreateCredentialUser,
6547
6548
  onCredentialsLoginSuccess,
6548
6549
  onExistingAccount,
@@ -6582,8 +6583,11 @@ var credentialsRegister = ({
6582
6583
  violations: policy.violations
6583
6584
  });
6584
6585
  }
6585
- const existing = await credentialStore.getCredentialByEmail(normalizedEmail);
6586
- if (existing) {
6586
+ const [existingCredential, existingUser] = await Promise.all([
6587
+ credentialStore.getCredentialByEmail(normalizedEmail),
6588
+ getUserByEmail(normalizedEmail)
6589
+ ]);
6590
+ if (existingCredential || existingUser) {
6587
6591
  if (revealRegistrationConflicts) {
6588
6592
  return status("Conflict", "Email is already registered");
6589
6593
  }
@@ -38811,5 +38815,5 @@ export {
38811
38815
  VerificationProviderError
38812
38816
  };
38813
38817
 
38814
- //# debugId=59EA26D2A962869F64756E2164756E21
38818
+ //# debugId=ABE5D9C482264EAE64756E2164756E21
38815
38819
  //# sourceMappingURL=server.js.map