UNPKG

@koex/passport-github

Version:
25 lines (24 loc) 904 B
import { Strategy, IVerify, IGetAuthorizeUrlData, IGetAccessTokenData } from '@koex/passport-oauth2'; export interface GithubStrategyOptions { client_id: string; client_secret: string; redirect_uri: string; } export interface Token { access_token: string; } export interface Profile { id: string; login: string; avatar_url: string; url: string; node_id: string; } export declare class GithubStrategy extends Strategy<Token, Profile> { private readonly _options; readonly verify: IVerify<Profile>; constructor(_options: GithubStrategyOptions, verify: IVerify<Profile>); protected getAuthorizeUrl(authorize_url: string, data: IGetAuthorizeUrlData): Promise<string>; protected getAccessToken(token_url: string, data: IGetAccessTokenData): Promise<Token>; protected getAccessUser(user_profile_url: string, access_token: Token): Promise<Profile>; }