modify passport type file

This commit is contained in:
Horiuchi_H
2014-08-22 20:19:28 +09:00
parent 042968c735
commit 432545c4d9
2 changed files with 17 additions and 5 deletions
+3
View File
@@ -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: '/',
+14 -5
View File
@@ -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;