mirror of
https://github.com/vector-im/element-web.git
synced 2025-10-03 11:32:07 +02:00
Error if email already in use when resetting pw
Use password reset specific requestToken
This commit is contained in:
parent
6d403e792b
commit
30cfc6b605
@ -48,11 +48,13 @@ class PasswordReset {
|
|||||||
*/
|
*/
|
||||||
resetPassword(emailAddress, newPassword) {
|
resetPassword(emailAddress, newPassword) {
|
||||||
this.password = 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;
|
this.sessionId = res.sid;
|
||||||
return res;
|
return res;
|
||||||
}, function(err) {
|
}, 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})`;
|
err.message = err.message + ` (Status ${err.httpStatus})`;
|
||||||
}
|
}
|
||||||
throw err;
|
throw err;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user