fix(auth): Fix auth flow for the client app

This commit is contained in:
Bouncey
2018-10-24 00:24:48 +01:00
committed by mrugesh mohapatra
parent a656cbf98a
commit c08bb95ea8
19 changed files with 348 additions and 212 deletions

View File

@ -7,12 +7,12 @@ import { login } from 'passport/lib/http/request';
// if called without callback it returns an observable
// login(user, options?, cb?) => Void|Observable
function login$(...args) {
console.log('args');
if (_.isFunction(_.last(args))) {
return login.apply(this, args);
}
return Observable.fromNodeCallback(login).apply(this, args);
}
export default function passportLogin() {
return (req, res, next) => {
req.login = req.logIn = login$;