backend-manager 2.5.25 → 2.5.27

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backend-manager",
3
- "version": "2.5.25",
3
+ "version": "2.5.27",
4
4
  "description": "Quick tools for developing Firebase functions",
5
5
  "main": "src/manager/index.js",
6
6
  "bin": {
@@ -11,7 +11,8 @@ function OAuth2() {
11
11
 
12
12
  authorize: 'https://discord.com/api/oauth2/authorize',
13
13
  tokenize: 'https://discord.com/api/oauth2/token',
14
- status: ''
14
+ status: '',
15
+ removeAccess: 'https://discord.com/channels/@me',
15
16
  }
16
17
  }
17
18
 
@@ -10,7 +10,8 @@ function OAuth2() {
10
10
  authorize: 'https://accounts.google.com/o/oauth2/v2/auth',
11
11
  tokenize: 'https://oauth2.googleapis.com/token',
12
12
  // status: 'https://oauth2.googleapis.com/tokeninfo?id_token={token}'
13
- status: 'https://oauth2.googleapis.com/tokeninfo'
13
+ status: 'https://oauth2.googleapis.com/tokeninfo',
14
+ removeAccess: 'https://myaccount.google.com/security',
14
15
  }
15
16
  }
16
17
 
@@ -97,11 +97,12 @@ Module.prototype.main = function () {
97
97
  newUrl.searchParams.set('redirect_uri', self.ultimateJekyllOAuth2Url);
98
98
 
99
99
  newUrl.searchParams.set('access_type', typeof payload.data.payload.access_type === 'undefined' ? 'offline' : payload.data.payload.access_type)
100
+ newUrl.searchParams.set('prompt', typeof payload.data.payload.prompt === 'undefined' ? 'consent' : payload.data.payload.prompt)
100
101
  newUrl.searchParams.set('include_granted_scopes', typeof payload.data.payload.include_granted_scopes === 'undefined' ? 'true' : payload.data.payload.include_granted_scopes)
101
102
  newUrl.searchParams.set('response_type', typeof payload.data.payload.response_type === 'undefined' ? 'code' : payload.data.payload.response_type)
102
103
  }
103
104
 
104
- assistant.log('OAuth2 newUrl', newUrl, {environment: 'production'});
105
+ assistant.log('OAuth2 newUrl', newUrl.toString(), newUrl, {environment: 'production'});
105
106
 
106
107
  await self.oauth2.buildUrl(payload.data.payload.state, newUrl)
107
108
  .then(url => {
@@ -214,6 +215,8 @@ Module.prototype.processState_tokenize = function (newUrl) {
214
215
 
215
216
  if (verifiedIdentity instanceof Error) {
216
217
  return reject(verifiedIdentity);
218
+ } else if (tokenizeResponse && !tokenizeResponse.refresh_token) {
219
+ return reject(new Error(`Missing "refresh_token" in response. This is likely because you disconnected your account and tried to reconnect it. Visit ${self.oauth2.urls.removeAccess} and remove our app from your account and then try again or contact us if you need help!`));
217
220
  }
218
221
 
219
222
  const storeResponse = await self.libraries.admin.firestore().doc(`users/${payload.user.auth.uid}`)