Skip to content

Commit

Permalink
Fix: bug forgot password
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaslabbe committed Oct 11, 2017
1 parent cb408cb commit 2b6b3fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/server/routes/users/get/forgot.js
Expand Up @@ -35,6 +35,10 @@ var route = function route(req, res) {
if (err) {
return res.status(200).json({success: 1})
}

if (!user) {
return showHtml(res, req, 'Email not found')
}

crypto.randomBytes(20, function(err, buf) {
var resetPasswordToken = buf.toString('hex')
Expand Down
6 changes: 2 additions & 4 deletions src/server/views/users/forgot.html
Expand Up @@ -12,9 +12,8 @@
<div class="panel-body">
{{#if info}}
<span class="text-danger">{{@root.info}}</span>
<br /><br />
<a href="/abe/users/login">Login</a>
{{else}}
<br />
{{/if}}
<form action="/abe/users/forgot" method="get">

<div class="form-group">
Expand All @@ -24,7 +23,6 @@
<input type="hidden" class="form-control" name="token" value="{{token}}">
<button type="submit" class="btn btn-default">Submit</button>
</form>
{{/if}}

{{abeImport 'login-more' config this}}
</div>
Expand Down

0 comments on commit 2b6b3fe

Please sign in to comment.