-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
30 lines (29 loc) · 1002 Bytes
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import type { OAuthConfig, OAuthUserConfig } from "next-auth/providers";
import { GuildedProfile } from "./typings";
export default function Guilded<P extends GuildedProfile>(options: OAuthUserConfig<P>): OAuthConfig<P> {
return {
id: "guilded",
name: "Guilded",
type: "oauth",
authorization: {
url: "https://authlink.app/auth",
params: { scope: "identify" }
},
token: "https://authlink.app/api/v1/token",
userinfo: "https://authlink.app/api/v1/users/@me",
profile(data: GuildedProfile) {
return {
id: data.id,
name: data.name,
subdomain: data.subdomain,
aliases: data.aliases,
avatar: data.avatar,
banner: data.banner,
createdAt: data.createdAt,
aboutInfo: data.aboutInfo,
lastOnline: data.lastOnline
};
},
options
};
}