Skip to content

Commit 837c1ba

Browse files
authored
add ui feedback on mismatched PWs (#949)
2 parents 8b07632 + 277f328 commit 837c1ba

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

packages/common-ui/src/components/auth/UserRegistration.vue

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<v-card>
3-
<v-card-title v-if="!registrationRoute" class="text-h5 bg-grey-lighten-2"> Create an Account </v-card-title>
3+
<v-card-title class="text-h5 bg-grey-lighten-2"> Create an Account </v-card-title>
44

55
<v-card-text>
66
<v-form @submit.prevent="createUser">
@@ -44,7 +44,8 @@
4444
name="retypedPassword"
4545
hover="Show password"
4646
label="Retype your password"
47-
hint=""
47+
:disabled="password === '' || !!passwordError"
48+
:hint="passwordRetypeError"
4849
min="4"
4950
:type="passwordVisible ? 'text' : 'password'"
5051
></v-text-field>
@@ -58,7 +59,7 @@
5859
<v-btn color="pink" variant="text" @click="badLoginAttempt = false"> Close </v-btn>
5960
</v-snackbar>
6061
<v-btn
61-
class="mr-2"
62+
class="mr-2 my-2"
6263
type="submit"
6364
:loading="awaitingResponse"
6465
:color="buttonStatus.color"
@@ -135,6 +136,14 @@ export default defineComponent({
135136
passwordError(): string {
136137
return validatePassword(this.password);
137138
},
139+
passwordRetypeError(): string {
140+
console.log('[RTE]');
141+
if (this.password !== this.retypedPassword) {
142+
return 'Passwords must match.';
143+
} else {
144+
return '';
145+
}
146+
},
138147
},
139148
140149
async created() {

packages/platform-ui/cypress/e2e/user-registration.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ describe('User Registration', () => {
5858
cy.contains('button', 'Create Account').should('be.disabled');
5959

6060
// Assert that an error message about password mismatch is displayed
61-
cy.contains('Passwords do not match').should('be.visible');
61+
cy.contains('Passwords must match').should('be.visible');
6262

6363
// Assert that we're still on the registration page
6464
cy.url().should('not.include', `/u/${username}`);

0 commit comments

Comments
 (0)