use (LMP)loopback middleware phases

bump loopback-component-passport which uses LMP
move custom middlewares to middlewares directory
This commit is contained in:
Berkeley Martinez
2015-08-04 01:25:34 -07:00
parent aa10e1ff69
commit f01a66c5c7
14 changed files with 259 additions and 248 deletions

View File

@ -0,0 +1,13 @@
export default function addReturnToUrl() {
return function(req, res, next) {
// Remember original destination before login.
var path = req.path.split('/')[1];
if (/auth|login|logout|signin|signup|fonts|favicon/i.test(path)) {
return next();
} else if (/\/stories\/\w+/i.test(req.path)) {
return next();
}
req.session.returnTo = req.path;
next();
};
}