mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
modify passport type file
This commit is contained in:
@@ -52,6 +52,9 @@ app.get('/logout', function(req, res) {
|
||||
res.redirect('/');
|
||||
});
|
||||
|
||||
app.post('/auth/token', passport.authenticate(['basic', 'oauth2-client-password'], { session: false }));
|
||||
|
||||
|
||||
function authSetting(): void {
|
||||
var authOption = {
|
||||
successRedirect: '/',
|
||||
|
||||
Vendored
+14
-5
@@ -7,7 +7,6 @@
|
||||
|
||||
declare module Express {
|
||||
export interface Request {
|
||||
session?: any;
|
||||
authInfo?: any;
|
||||
|
||||
// These declarations are merged into express's Request type
|
||||
@@ -36,7 +35,12 @@ declare module 'passport' {
|
||||
|
||||
function authenticate(strategy: string, callback?: Function): express.Handler;
|
||||
function authenticate(strategy: string, options: Object, callback?: Function): express.Handler;
|
||||
function authorize(strategy: string, options: Object, callback?: express.Handler): express.Handler;
|
||||
function authenticate(strategies: string[], callback?: Function): express.Handler;
|
||||
function authenticate(strategies: string[], options: Object, callback?: Function): express.Handler;
|
||||
function authorize(strategy: string, callback?: Function): express.Handler;
|
||||
function authorize(strategy: string, options: Object, callback?: Function): express.Handler;
|
||||
function authorize(strategies: string[], callback?: Function): express.Handler;
|
||||
function authorize(strategies: string[], options: Object, callback?: Function): express.Handler;
|
||||
function serializeUser(fn: (user: any, done: (err: any, id: any) => void) => void): void;
|
||||
function deserializeUser(fn: (id: any, done: (err: any, user: any) => void) => void): void;
|
||||
function transformAuthInfo(fn: (info: any, done: (err: any, info: any) => void) => void): void;
|
||||
@@ -49,9 +53,14 @@ declare module 'passport' {
|
||||
initialize(options?: { userProperty: string; }): express.Handler;
|
||||
session(options?: { pauseStream: boolean; }): express.Handler;
|
||||
|
||||
authenticate(strategy: string, callback2: (err: any, user: any, info: any) => void): express.Handler;
|
||||
authenticate(strategy: string, options: Object, callback?: express.Handler): express.Handler;
|
||||
authorize(strategy: string, options: Object, callback?: express.Handler): express.Handler;
|
||||
authenticate(strategy: string, callback?: Function): express.Handler;
|
||||
authenticate(strategy: string, options: Object, callback?: Function): express.Handler;
|
||||
authenticate(strategies: string[], callback?: Function): express.Handler;
|
||||
authenticate(strategies: string[], options: Object, callback?: Function): express.Handler;
|
||||
authorize(strategy: string, callback?: Function): express.Handler;
|
||||
authorize(strategy: string, options: Object, callback?: Function): express.Handler;
|
||||
authorize(strategies: string[], callback?: Function): express.Handler;
|
||||
authorize(strategies: string[], options: Object, callback?: Function): express.Handler;
|
||||
serializeUser(fn: (user: any, done: (err: any, id: any) => void) => void): void;
|
||||
deserializeUser(fn: (id: any, done: (err: any, user: any) => void) => void): void;
|
||||
transformAuthInfo(fn: (info: any, done: (err: any, info: any) => void) => void): void;
|
||||
|
||||
Reference in New Issue
Block a user