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 / recovery is broken #1502

Closed
k0nsl opened this issue Nov 27, 2015 · 10 comments
Closed

Password reset / recovery is broken #1502

k0nsl opened this issue Nov 27, 2015 · 10 comments

Comments

@k0nsl
Copy link
Contributor

k0nsl commented Nov 27, 2015

I only tested this on the server hosted by the developers of Rocket.Chat and didn't test it on my own installation.
When requesting a password reset it does send you the e-mail and it is received with no problem. However, once you hit the link in the e-mail (the one looking like this: https://demo.rocket.chat/login/#/reset-password/{long_string}) it won't load the input box which usually asks you for the new password, instead you're taken to the login screen without any apparent error.

This is the output from my developer console:
rocketchat_passwordreset

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@k0nsl k0nsl changed the title Password reset is broken Password reset / recovery is broken Nov 27, 2015
@haceru
Copy link

haceru commented Nov 28, 2015

I tested on my own installation and it is broken indeed. Same behavior as above, just redirects to the login screen

@bernardoflynn
Copy link

Yep I've just followed the docker installation instructions and I'm now locked out :( Forgot password just sends you back to the login screen and Rocket.Chat tells me my admin email or password is wrong (I saved it using a password manager so it can't be wrong)

@mquandalle
Copy link

I had the same problem with Wekan, and in my case that was because the routes configuration was done on the client only — and not the server. Not sure if that helps.

@tholu
Copy link
Contributor

tholu commented Dec 1, 2015

+1 Broken here as well.

See here for accessing the mongo database directly when deployed via docker:
#766 (comment)

@bernardoflynn Did you by chance enable email confirmations before being locked out? Then see the referenced comment to restore access.

@tholu
Copy link
Contributor

tholu commented Dec 1, 2015

You can manually generate a password hash like this (replace 'password') and then update the mongo database directly:

#!/usr/bin/env node

var bcrypt = require('bcrypt');
var crypto = require('crypto');
var pwd = 'password';

bcrypt.genSalt(10, function(err, salt) {
    var sha256 = crypto.createHash('sha256').update(pwd).digest('hex');
    bcrypt.hash(sha256, salt, function(err, hash) {
        // Store hash in your password DB. 
        console.log(hash);
    });
});

@graywolf336
Copy link
Contributor

I believe this is also related to email confirmations not working as well, as they use the same url type "#" to state what is happening.

@adrianb88
Copy link

@graywolf336
any news/update how to solve the email confirmation issue?

@graywolf336
Copy link
Contributor

@adrianb88 Not yet, if someone else doesn't do it before me this weekend I will take a look

@tholu
Copy link
Contributor

tholu commented Dec 2, 2015

Just tested again with the latest docker image from 29 hours ago (previous was from 11 days ago), problem still there. @graywolf336 Thanks, that would be great!

@jjayala1
Copy link

jjayala1 commented Dec 9, 2015

Some of my team lost his password, I update directly the database as suggested by @tholu .

I want to share the steps I used (I installed via composer):

1.- docker exec -it rocketchat_db_1 bash (log in to the container, use the appropiate container name)
2.- mongo (enter in database)
3.- use rocketchat (change to rocketchat database)
4.- db.getCollection('users').find({ username:"Jonh"}) (find _id for user Jonh)
5.- db.getCollection('users').update({_id:"gYvyetq89wtnvEk9K"}, { $set: {"services" : { "password" : {"bcrypt" : "$2a$10$n9CM8OgInDlwpvjLKLPML.eizXIzLlRtgCh3GRLafOdR9ldAUh/KG" } } } }) (reset John's password to 12345, use the _id obtained in step 4)
6.- quit() (quit mongo)
7.- exit (quit container)

I hope it could be useful

engelgabriel added a commit that referenced this issue Dec 28, 2015
engelgabriel added a commit that referenced this issue Dec 29, 2015
# By Diego Sampaio (8) and Rodrigo Nascimento (2)
# Via Gabriel Engel (3) and Rodrigo Nascimento (2)
* 'develop' of github.com:RocketChat/Rocket.Chat:
  Increase the delay to render color fields
  fix guest users default role
  standardize colors definition
  improved clean button color
  support named color for message attachments
  added request debug messages
  trim integration messages
  Try to parse all request bodies as JSON
  new password reset screen
  fix reset password - closes #1502
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

9 participants