mirror of
https://github.com/vector-im/element-web.git
synced 2025-08-24 07:51:34 +02:00
Merge pull request #337 from matrix-org/dbkr/password_reset_email_not_found
Error if email already in use when resetting pw
This commit is contained in:
commit
ae7e51ae17
@ -48,11 +48,13 @@ class PasswordReset {
|
||||
*/
|
||||
resetPassword(emailAddress, newPassword) {
|
||||
this.password = newPassword;
|
||||
return this.client.requestEmailToken(emailAddress, this.clientSecret, 1).then((res) => {
|
||||
return this.client.requestPasswordEmailToken(emailAddress, this.clientSecret, 1).then((res) => {
|
||||
this.sessionId = res.sid;
|
||||
return res;
|
||||
}, function(err) {
|
||||
if (err.httpStatus) {
|
||||
if (err.errcode == 'M_THREEPID_NOT_FOUND') {
|
||||
err.message = "This email address was not found";
|
||||
} else if (err.httpStatus) {
|
||||
err.message = err.message + ` (Status ${err.httpStatus})`;
|
||||
}
|
||||
throw err;
|
||||
|
Loading…
x
Reference in New Issue
Block a user