fix(core): Make password-reset urls valid only for single-use (#7622)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-11-07 15:35:43 +01:00
committed by GitHub
parent b3470fd64d
commit 60314248f4
13 changed files with 206 additions and 168 deletions

View File

@@ -93,7 +93,7 @@
"auth.changePassword.passwordUpdatedMessage": "You can now sign in with your new password",
"auth.changePassword.passwordsMustMatchError": "Passwords must match",
"auth.changePassword.reenterNewPassword": "Re-enter new password",
"auth.changePassword.tokenValidationError": "Issue validating invite token",
"auth.changePassword.tokenValidationError": "Invalid password-reset token",
"auth.defaultPasswordRequirements": "8+ characters, at least 1 number and 1 capital letter",
"auth.validation.missingParameters": "Missing token or user id",
"auth.email": "Email",

View File

@@ -103,10 +103,8 @@ export default defineComponent({
await this.usersStore.validatePasswordToken({ token });
} catch (e) {
this.showMessage({
title: this.$locale.baseText('auth.changePassword.tokenValidationError'),
type: 'error',
});
this.showError(e, this.$locale.baseText('auth.changePassword.tokenValidationError'));
void this.$router.replace({ name: VIEWS.SIGNIN });
}
},
methods: {

View File

@@ -121,7 +121,7 @@ export default defineComponent({
async onSubmit(values: { [key: string]: string | boolean }) {
if (!this.inviterId || !this.inviteeId) {
this.showError(
new Error(this.$locale.baseText('auth.changePassword.tokenValidationError')),
new Error(this.$locale.baseText('auth.signup.tokenValidationError')),
this.$locale.baseText('auth.signup.setupYourAccountError'),
);
return;