mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
now really fixed travis failing
This commit is contained in:
Vendored
+2
-2
@@ -9,7 +9,7 @@
|
||||
import * as passport from 'passport';
|
||||
import * as express from 'express';
|
||||
|
||||
declare class Strategy<T> implements passport.Strategy {
|
||||
declare class Strategy implements passport.Strategy {
|
||||
constructor(options: Strategy.IStrategyOption, verify: (accessToken: string, refreshToken: string, profile: Strategy.Profile, done: (error: any, user?: any) => void) => void);
|
||||
name: string;
|
||||
authenticate: (req: express.Request, options?: Object) => void;
|
||||
@@ -24,7 +24,7 @@ declare namespace Strategy {
|
||||
|
||||
interface Profile extends passport.Profile {
|
||||
profileUrl: string;
|
||||
id: number|string;
|
||||
id: any;
|
||||
username: string;
|
||||
provider: string;
|
||||
email: string;
|
||||
|
||||
@@ -2,24 +2,22 @@
|
||||
|
||||
/**
|
||||
* Created by AtlasDev on 4/10/2016.
|
||||
* Based on typings from passport-facebook by jcabresos.
|
||||
*/
|
||||
import passport = require('passport');
|
||||
import beam = require('passport-beam');
|
||||
import Beam = require('passport-beam');
|
||||
|
||||
var User = {
|
||||
findOrCreate(id:string, provider:string, callback:(err:any, user:any) => void): void {
|
||||
findOrCreate(id:string, provider:string, callback:(err:Error, user:any) => void): void {
|
||||
callback(null, { username: 'Dany' });
|
||||
}
|
||||
}
|
||||
|
||||
passport.use(new beam.Strategy({
|
||||
clientID: BEAM_CLIENT_ID,
|
||||
clientSecret: BEAM_CLIENT_SECRET,
|
||||
passport.use(new Beam({
|
||||
clientID: process.env.BEAM_CLIENT_ID,
|
||||
clientSecret: process.env.BEAM_CLIENT_SECRET,
|
||||
callbackURL: "http://127.0.0.1:3000/auth/beam/callback"
|
||||
},
|
||||
function(accessToken:string, refreshToken:string, profile:beam.Profile, done:(error:any, user?:any) => void) {
|
||||
User.findOrCreate(profile.id, profile.provider, function(err, user) {
|
||||
}, (accessToken:string, refreshToken:string, profile:Beam.Profile, done:(error:any, user?:any) => void) => {
|
||||
User.findOrCreate(profile.id, profile.provider, (err, user) => {
|
||||
if (err) { return done(err); }
|
||||
done(null, user);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user