feat: added google support

This commit is contained in:
Wyatt Johnson
2018-10-29 17:36:15 -06:00
parent 58e51b299d
commit 93b91a0573
9 changed files with 207 additions and 22 deletions
+38
View File
@@ -0,0 +1,38 @@
declare module "passport-google-oauth2" {
import express from "express";
import passport from "passport";
export interface Profile extends passport.Profile {
id: string;
displayName: string;
}
export interface AuthenticateOptions extends passport.AuthenticateOptions {
authType?: string;
}
export interface StrategyOptionWithRequest {
clientID: string;
clientSecret: string;
callbackURL: string;
passReqToCallback: true;
}
export type VerifyFunctionWithRequest = (
req: express.Request,
accessToken: string,
refreshToken: string,
profile: Profile,
done: (error: any, user?: any, info?: any) => void
) => void;
export class Strategy extends passport.Strategy {
constructor(
options: StrategyOptionWithRequest,
verify: VerifyFunctionWithRequest
);
public name: string;
public authenticate(req: express.Request, options?: object): void;
}
}