@eaccess/auth 0.1.12 → 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
@@ -120,13 +120,13 @@ var AuthRole = {
120
120
  Consultant: 8,
121
121
  Consumer: 16,
122
122
  Contributor: 32,
123
- Coordinator: 64,
123
+ Owner: 64,
124
124
  Creator: 128,
125
125
  Developer: 256,
126
126
  Director: 512,
127
127
  Editor: 1024,
128
128
  Employee: 2048,
129
- Maintainer: 4096,
129
+ Member: 4096,
130
130
  Manager: 8192,
131
131
  Moderator: 16384,
132
132
  Publisher: 32768,
@@ -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, {