@eaccess/auth 0.1.13 → 0.1.14

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.cjs CHANGED
@@ -714,7 +714,7 @@ var BaseOAuthProvider = class {
714
714
  }
715
715
  async handleCallback(req) {
716
716
  const userData = await this.getUserData(req);
717
- await this.processOAuthLogin(userData, req);
717
+ return this.processOAuthLogin(userData, req);
718
718
  }
719
719
  async processOAuthLogin(userData, req) {
720
720
  const { queries } = this.authManager;
@@ -724,7 +724,7 @@ var BaseOAuthProvider = class {
724
724
  const account2 = await queries.findAccountById(existingProvider.account_id);
725
725
  if (account2) {
726
726
  await this.authManager.onLoginSuccessful(account2, false);
727
- return;
727
+ return { isNewUser: false };
728
728
  }
729
729
  }
730
730
  if (userData.email) {
@@ -759,6 +759,7 @@ var BaseOAuthProvider = class {
759
759
  providerAvatar: userData.avatar || null
760
760
  });
761
761
  await this.authManager.onLoginSuccessful(account, false);
762
+ return { isNewUser: true };
762
763
  }
763
764
  async exchangeCodeForToken(code, tokenUrl) {
764
765
  const response = await fetch(tokenUrl, {