Skip to content

Commit 129d161

Browse files
authored
fix(providers): Refactor Line Provider (#2917)
* feat(providers): Refactor Line Provider * Use static wellKnown + retrieve email * Remove issuer
1 parent 19e326e commit 129d161

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

app/.env.local.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ TWITCH_SECRET=
3030
TWITTER_ID=
3131
TWITTER_SECRET=
3232

33+
LINE_ID=
34+
LINE_SECRET=
35+
3336
# Example configuration for a Gmail account (will need SMTP enabled)
3437
EMAIL_SERVER=smtps://user@gmail.com:password@smtp.gmail.com:465
3538
EMAIL_FROM=user@gmail.com

src/providers/line.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@ export default function LINE(options) {
44
id: "line",
55
name: "LINE",
66
type: "oauth",
7-
authorization:
8-
"https://access.line.me/oauth2/v2.1/authorize?scope=openid+profile",
9-
token: "https://api.line.me/oauth2/v2.1/token",
10-
userinfo: "https://api.line.me/v2/profile",
7+
authorization: { params: { scope: "openid profile" } },
8+
idToken: true,
9+
wellKnown: "https://access.line.me/.well-known/openid-configuration",
1110
profile(profile) {
1211
return {
13-
id: profile.userId,
14-
name: profile.displayName,
15-
email: null,
16-
image: profile.pictureUrl,
12+
id: profile.sub,
13+
name: profile.name,
14+
email: profile.email,
15+
image: profile.picture,
1716
}
1817
},
1918
options,

0 commit comments

Comments
 (0)