silsilah icon indicating copy to clipboard operation
silsilah copied to clipboard

Unable to retrieve password using Forgot Password feature while running the DB locally

Open akhan85 opened this issue 4 years ago • 7 comments

Is there a way to recover a password from the database for an account created if the application is running on a local server i.e. without being hosted anywhere. I am currently running a DB instance on my laptop and if I try to use the forgot password feature, I run into the following error:

image

File path: silsilah/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php

akhan85 avatar Mar 06 '20 02:03 akhan85

Hi @akhan85, I will try to reproduce it first, thanks for reporting this.

nafiesl avatar Mar 08 '20 13:03 nafiesl

No problem. Let me know if I can add any further details to help reproduce the issue. Thanks.

akhan85 avatar Mar 13 '20 17:03 akhan85

Hi @akhan85, I have managed reproducing the same error like you did.

screen_20-03-15_002

In the current condition, this email reset password is depend on password reset email feature, which is built in feature of laravel.

Possible solutions:

If you were host your app in localhost, then I think we can pick one of these options to reset user's password:

  1. Direct DB update using this hashed "password" string. We can use this sql script
UPDATE `users` SET `password`='$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi' WHERE  `id`='{your-user-id}';
  1. If we were logged in, and we were the one who have created the user, then we can set (replace) the user's password on user's edit page.

screen_20-03-15_006

nafiesl avatar Mar 15 '20 12:03 nafiesl

Thank you for your response @nafiesl . So I can't use the second option as it would require that I remember the password in the first place (which I don't) and am able to login. For the first option, can you tell me where to run that script exactly? Thanks again.

akhan85 avatar Mar 16 '20 14:03 akhan85

For the first option, you can run it on your MySQL client app, for me, I can run it on HeidiSQL, on the Query tab.

screen_20-03-16_008

nafiesl avatar Mar 16 '20 15:03 nafiesl

Ok so here is what I found on my end. I am using MySQL Workbench client. I had to slightly modify the UPDATE command and use UPDATE 'table_name'.users instead. So in the case of the screenshot that you have attached it would be UPDATE lv_2017_silsilah.users

I think that I have cleared the password field altogether in the DB. I am guessing I was supposed to find the hashed password string first and it would have been unique to my case? In any case, I still get a 'These credentials do not match our records.' when attempting to log in using a blank entry for password or by using what I think is the old password.

akhan85 avatar Mar 16 '20 18:03 akhan85

assalamualaykum,, Maaf mas mau tanya,, di hosting juga error untuk fitur lupa password,, saya sesuaikan di env untuk smptnya tapi masih dapet error image terima kasih

gusem avatar Dec 25 '20 09:12 gusem