Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Password reset #33

Closed
16 tasks done
polyccon opened this issue Oct 4, 2017 · 1 comment
Closed
16 tasks done

Password reset #33

polyccon opened this issue Oct 4, 2017 · 1 comment

Comments

@polyccon
Copy link
Collaborator

polyccon commented Oct 4, 2017

Functionality for the users to reset their passwords should they forget them would be nice to add.

  • /forgot GET: User enters email address
  • /forgot POST:
    • Check entered email address is registered
    • Generate unique reset token
    • Store token and users email in redis
    • Email link containing token to user
    • Token should expire (see comment)
    • Token should be single-use (use del command after we've finished with it. All redis commands are available in node-redis module)
  • /reset/:token GET:
    • Check token in url is valid by accessing it in redis
    • User enters new password (twice)
  • /reset POST:
    • Get email associated with token being used
    • New password should be validated just like original one is (e.g. more than 8 characters)
    • Use email to update users password in db
    • Redirect to /login and provide success flash message
@dangerdak
Copy link
Collaborator

Add expiry to key: https://github.com/NodeRedis/node_redis#redis-commands

// this key will expire after 10 seconds
client.set('key', 'value!', 'EX', 10);

polyccon added a commit that referenced this issue Nov 1, 2017
polyccon added a commit that referenced this issue Nov 1, 2017
polyccon added a commit that referenced this issue Nov 1, 2017
polyccon added a commit that referenced this issue Nov 1, 2017
…n is valid

need to add expiry date for token and database query
dangerdak added a commit that referenced this issue Nov 2, 2017
dangerdak added a commit that referenced this issue Nov 2, 2017
dangerdak added a commit that referenced this issue Nov 2, 2017
dangerdak added a commit that referenced this issue Nov 2, 2017
dangerdak added a commit that referenced this issue Nov 3, 2017
polyccon added a commit that referenced this issue Nov 3, 2017
polyccon added a commit that referenced this issue Nov 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants