mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-31 03:02:04 +08:00
Fix: missing passReqToCallback for passport-kakao (#28722)
* Fix: missing passReqToCallback property for passport-kakao * Fix: only major.minor version allowed
This commit is contained in:
committed by
Ryan Cavanaugh
parent
37b5c6a8e4
commit
36ee07bd00
10
types/passport-kakao/index.d.ts
vendored
10
types/passport-kakao/index.d.ts
vendored
@@ -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 <https://github.com/Park9eon>
|
||||
// ZeroCho <https://github.com/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;
|
||||
|
||||
@@ -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
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user