Skip to content

Commit 4a0b8b2

Browse files
fix(registration): display blocked username error in UI
1 parent 86af4e2 commit 4a0b8b2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/web-ui-registration/src/RegisterForm.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,13 @@ export const RegisterForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRo
9090
if ([error.error, error.errorType].includes('error-invalid-email')) {
9191
setError('email', { type: 'invalid-email', message: t('registration.component.form.invalidEmail') });
9292
}
93+
if (error.errorType === 'error-blocked-username') {
94+
setError('username', {
95+
type: 'error-blocked-username',
96+
message: t('error-blocked-username', { field: getValues('username') }),
97+
});
98+
return;
99+
}
93100
if (error.errorType === 'error-user-already-exists') {
94101
setError('username', { type: 'user-already-exists', message: t('registration.component.form.usernameAlreadyExists') });
95102
}

0 commit comments

Comments
 (0)