diff --git a/types/passport-kakao/index.d.ts b/types/passport-kakao/index.d.ts index b005b45d98..dbb4c2f07b 100644 --- a/types/passport-kakao/index.d.ts +++ b/types/passport-kakao/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for passport-kakao 0.1 +// Type definitions for passport-kakao 0.2 // Project: https://github.com/rotoshine/passport-kakao // Definitions by: Park9eon +// ZeroCho // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -24,11 +25,18 @@ export interface StrategyOption { customHeaders?: string; } +export interface StrategyOptionWithRequest extends StrategyOption { + passReqToCallback: boolean; +} + export type VerifyFunction = (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void; +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: StrategyOption, verify: VerifyFunction); + constructor(options: StrategyOptionWithRequest, verify: VerifyFunctionWithRequest); authenticate(req: express.Request, options?: any): void; userProfile: (accessToken: string, done: (error: any, user?: any) => void) => void; diff --git a/types/passport-kakao/passport-kakao-tests.ts b/types/passport-kakao/passport-kakao-tests.ts index 595404cc5b..5f104f6c41 100644 --- a/types/passport-kakao/passport-kakao-tests.ts +++ b/types/passport-kakao/passport-kakao-tests.ts @@ -1,10 +1,11 @@ -import {Strategy as KakaoStrategy } from 'passport-kakao'; +import { Strategy as KakaoStrategy } from 'passport-kakao'; new KakaoStrategy({ clientID: 'client', clientSecret: 'clientSecret', - callbackURL: 'callbackUrl' + callbackURL: 'callbackUrl', }, (accessToken: string, refreshToken: string, profile: any, done: any) => { // signUp or signIn - }); + }, +);