Skip to content

Commit acc897a

Browse files
author
Rishabh
committed
fixes issue with discord login
1 parent 2fb778b commit acc897a

File tree

10 files changed

+39
-21
lines changed

10 files changed

+39
-21
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [unreleased]
99

10+
## [9.1.1] - 2022-03-24
11+
12+
### Fixes:
13+
14+
- Changes Github and Discord providers to check if email is `undefined` or not before assigning the email object to the profile info.
15+
1016
## [9.1.0] - 2022-03-17
1117

1218
- Added `ThirdPartyPasswordless` recipe + tests

lib/build/recipe/thirdparty/providers/discord.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,13 @@ function Discord(config) {
7575
let userInfo = response.data;
7676
return {
7777
id: userInfo.id,
78-
email: {
79-
id: userInfo.email,
80-
isVerified: userInfo.verified,
81-
},
78+
email:
79+
userInfo.email === undefined
80+
? undefined
81+
: {
82+
id: userInfo.email,
83+
isVerified: userInfo.verified,
84+
},
8285
};
8386
});
8487
}

lib/build/recipe/thirdparty/providers/github.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,13 @@ function Github(config) {
106106
let isVerified = emailInfo !== undefined ? emailInfo.verified : false;
107107
return {
108108
id,
109-
email: {
110-
id: emailInfo.email,
111-
isVerified,
112-
},
109+
email:
110+
emailInfo.email === undefined
111+
? undefined
112+
: {
113+
id: emailInfo.email,
114+
isVerified,
115+
},
113116
};
114117
});
115118
}

lib/build/version.d.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/build/version.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/ts/recipe/thirdparty/providers/discord.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,13 @@ export default function Discord(config: TypeThirdPartyProviderDiscordConfig): Ty
7575
let userInfo = response.data;
7676
return {
7777
id: userInfo.id,
78-
email: {
79-
id: userInfo.email,
80-
isVerified: userInfo.verified,
81-
},
78+
email:
79+
userInfo.email === undefined
80+
? undefined
81+
: {
82+
id: userInfo.email,
83+
isVerified: userInfo.verified,
84+
},
8285
};
8386
}
8487
return {

lib/ts/recipe/thirdparty/providers/github.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,13 @@ export default function Github(config: TypeThirdPartyProviderGithubConfig): Type
105105
let isVerified = emailInfo !== undefined ? emailInfo.verified : false;
106106
return {
107107
id,
108-
email: {
109-
id: emailInfo.email,
110-
isVerified,
111-
},
108+
email:
109+
emailInfo.email === undefined
110+
? undefined
111+
: {
112+
id: emailInfo.email,
113+
isVerified,
114+
},
112115
};
113116
}
114117
return {

lib/ts/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
* License for the specific language governing permissions and limitations
1313
* under the License.
1414
*/
15-
export const version = "9.1.0";
15+
export const version = "9.1.1";
1616

1717
export const cdiSupported = ["2.8", "2.9", "2.10", "2.11", "2.12"];

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "supertokens-node",
3-
"version": "9.1.0",
3+
"version": "9.1.1",
44
"description": "NodeJS driver for SuperTokens core",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)