Skip to content

Commit 5725931

Browse files
authored
fix(providers): add default id_token_signed_response_alg to LINE (#3059)
* Add default value for client in Line Provider * Migrate to TypeScript
1 parent c8b7e2e commit 5725931

File tree

2 files changed

+38
-20
lines changed

2 files changed

+38
-20
lines changed

src/providers/line.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/providers/line.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { OAuthConfig, OAuthUserConfig } from "."
2+
3+
export interface LineProfile {
4+
iss: string;
5+
sub: string;
6+
aud: string;
7+
exp: number;
8+
iat: number;
9+
amr: string[];
10+
name: string;
11+
picture: string;
12+
user: any;
13+
}
14+
15+
export default function LINE<
16+
P extends Record<string, any> = LineProfile
17+
>(options: OAuthUserConfig<P>): OAuthConfig<P> {
18+
return {
19+
id: "line",
20+
name: "LINE",
21+
type: "oauth",
22+
authorization: { params: { scope: "openid profile" } },
23+
idToken: true,
24+
wellKnown: "https://access.line.me/.well-known/openid-configuration",
25+
profile(profile) {
26+
return {
27+
id: profile.sub,
28+
name: profile.name,
29+
email: profile.email,
30+
image: profile.picture,
31+
}
32+
},
33+
client: {
34+
id_token_signed_response_alg: "HS256",
35+
},
36+
options
37+
}
38+
}

0 commit comments

Comments
 (0)