diff --git a/src/register/components/RegistrationFailure.jsx b/src/register/components/RegistrationFailure.jsx index c34c2af7..96d12d3e 100644 --- a/src/register/components/RegistrationFailure.jsx +++ b/src/register/components/RegistrationFailure.jsx @@ -9,6 +9,7 @@ import PropTypes from 'prop-types'; import { windowScrollTo } from '../../data/utils'; import { FORBIDDEN_REQUEST, + FORBIDDEN_USERNAME, INTERNAL_SERVER_ERROR, TPA_AUTHENTICATION_FAILURE, TPA_SESSION_EXPIRED, @@ -48,6 +49,9 @@ const RegistrationFailureMessage = (props) => { case TPA_SESSION_EXPIRED: errorMessage = formatMessage(messages['registration.tpa.session.expired'], { provider: context.provider }); break; + case FORBIDDEN_USERNAME: + errorMessage = formatMessage(messages['registration.forbidden.username']); + break; default: errorMessage = formatMessage(messages['registration.empty.form.submission.error']); break; diff --git a/src/register/data/constants.js b/src/register/data/constants.js index 721eedb9..28319833 100644 --- a/src/register/data/constants.js +++ b/src/register/data/constants.js @@ -11,3 +11,4 @@ export const FORM_SUBMISSION_ERROR = 'form-submission-error'; export const INTERNAL_SERVER_ERROR = 'internal-server-error'; export const TPA_AUTHENTICATION_FAILURE = 'tpa-authentication-failure'; export const TPA_SESSION_EXPIRED = 'tpa-session-expired'; +export const FORBIDDEN_USERNAME = 'forbidden-username'; diff --git a/src/register/messages.jsx b/src/register/messages.jsx index 39d9e7f5..f1750e6e 100644 --- a/src/register/messages.jsx +++ b/src/register/messages.jsx @@ -162,6 +162,11 @@ const messages = defineMessages({ defaultMessage: 'Registration using {provider} has timed out.', description: '', }, + 'registration.forbidden.username': { + id: 'registration.forbidden.username', + defaultMessage: 'Usernames can\'t include words that could be mistaken for course roles. Please choose a different username.', + description: '', + }, 'registration.tpa.authentication.failure': { id: 'registration.tpa.authentication.failure', defaultMessage: 'We are sorry, you are not authorized to access {platform_name} via this channel. '