Permalink
Browse files

Re-enabled support for redirect after log in

  • Loading branch information...
davidmerfield committed Jan 11, 2019
1 parent 6f8b94f commit be632d6b5806c6935767e1547f33a603b0eb544b
@@ -157,6 +157,7 @@ function checkEmail (req, res, next) {

req.user = user;
res.locals.email = user.email;
res.locals.then = req.query.then;

next();
});
@@ -190,7 +191,7 @@ function checkPassword (req, res, next) {

var user = req.user;
var password = req.body && req.body.password;
var then = (req.query && req.query.then) || '/';
var then = req.query.then || req.body.then || '/';

if (password === '') {
return next(new LogInError('NOPASSWORD'));
@@ -28,7 +28,7 @@
{{/error}}
</div>

<form style="max-width:18rem" method="POST" action="?_csrf={{csrf}}">
<form style="max-width:18rem" method="POST">

<label class="pt3 db" for="email">Your email address</label>
<input class="w-100 mt1 mb3 br2 pa2 ba b--black-30" id="email" type="text" size="20" class="email" name="email" autofocus/>
@@ -3,7 +3,7 @@

<div class="w-right-offset">

<form method="POST" action="?_csrf={{csrf}}">
<form method="POST">

<input type="hidden" name="email" value="{{email}}" />

@@ -25,9 +25,10 @@

</form>

<form style="max-width:18rem" method="POST" action="?_csrf={{csrf}}">
<form style="max-width:18rem" method="POST">

<label class="pt3 db" for="email">Your password</label>
<input type="hidden" name="then" value="{{then}}" />
<input type="hidden" name="email" value="{{email}}" />
<input class="w-100 mt1 mb3 br2 pa2 ba b--black-30" id="password" type="password" name="password" autofocus/>

0 comments on commit be632d6

Please sign in to comment.