mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
Don't send plaintext reset passwords via email (#8457)
* start work to avoid sending reset password in plaintext via email * start checking parameters * fix new password reset email * render error if password reset code is missing or invalid * implement POST route, conversion to bcrypt and messages * add auth.local.passwordResetCode field * add failing tests, move reset code validation func to lib, fixes, remove old tests * fix unit tests * fix page rendering and add integration tests * fix password reset page * add integration test * fix string * fix tests url
This commit is contained in:
@@ -59,7 +59,9 @@ let schema = new Schema({
|
||||
type: String,
|
||||
enum: ['bcrypt', 'sha1'],
|
||||
},
|
||||
salt: String, // Salt for SHA1 encrypted passwords, not stored for bcrypt
|
||||
salt: String, // Salt for SHA1 encrypted passwords, not stored for bcrypt,
|
||||
// Used to validate password reset codes and make sure only the most recent one can be used
|
||||
passwordResetCode: String,
|
||||
},
|
||||
timestamps: {
|
||||
created: {type: Date, default: Date.now},
|
||||
|
||||
Reference in New Issue
Block a user