mirror of
https://github.com/wassname/talk.git
synced 2026-07-23 13:10:20 +08:00
feat: added google support
This commit is contained in:
+38
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user