UNPKG

@daliboru/payload-auth-plugin-fork

Version:

Forked payload-auth-plugin with custom access token feature.

32 lines (31 loc) 825 B
// src/providers/oauth2/github.ts var authorization_server = { issuer: "https://github.com", authorization_endpoint: "https://github.com/login/oauth/authorize", token_endpoint: "https://github.com/login/oauth/access_token", userinfo_endpoint: "https://api.github.com/user" }; function GitHubAuthProvider(config) { const { overrideScope, ...restConfig } = config; return { ...restConfig, id: "github", scope: overrideScope ?? "openid email profile", authorization_server, name: "GitHub", algorithm: "oauth2", kind: "oauth", profile: (profile) => { return { sub: profile.id, name: profile.name, email: profile.email, picture: profile.picture }; } }; } var github_default = GitHubAuthProvider; export { github_default as default };