Stories reply and upvote redirect to signin when user isn't signed in.
Redirects user back to story after signing in.
This commit is contained in:
4
app.js
4
app.js
@ -209,7 +209,9 @@ app.use(function (req, res, next) {
|
||||
app.use(function (req, res, next) {
|
||||
// Remember original destination before login.
|
||||
var path = req.path.split('/')[1];
|
||||
if (/auth|login|logout|signup|fonts|favicon/i.test(path)) {
|
||||
if (/auth|login|logout|signin|signup|fonts|favicon/i.test(path)) {
|
||||
return next();
|
||||
} else if (/\/stories\/comments\/\w+/i.test(req.path)) {
|
||||
return next();
|
||||
}
|
||||
req.session.returnTo = req.path;
|
||||
|
Reference in New Issue
Block a user