I am having trouble editing the self-registration error when I enter an existing email.
Right now, the error currently reads: “A user with this Email already exists”
I want it to say: “A user with this Email already exists. Login with the same Email or use different Email address to create a new account. If you forgot the password, use the ‘Forgot Password?’ option to reset your password.”
I cannot find anywhere where I set it to “A user with this Email already exists” in my custom HTML. The closest I can find in login.properties github page is:
errors.E0000114 = A user with this login already exists in the current organization. registration.error.userName.notUniqueWithinOrg=An account with that email already exists
When I modify this in the config properties before rendering the widget, it does not affect the error text, but I am able to modify plenty of other errors in the same manner.
Hi, thanks for your message. I do all of my modifications to the config property before rendering the widget.
First I render the widget:
var config = OktaUtil.getSignInWidgetConfig();
Then before rending, I set the potentially relevant errors as follows:
config.i18n.en["errors.E0000114"] ="test test test"
config.i18n.en["registration.error.userName.notUniqueWithinOrg"] ="A user with this Email already exists. Login with the same Email or use different Email address to create a new account. If you forgot the password, use 'Forgot Password?' option to reset your password.
I console log the object to ensure the property was set, but there is no affect on the registration error.
It appears that text is only affected by modifying the self-service username field label in the self-service properties set by an administrator. So the error could say for example: “A user with this [editable text] already exists”.
You want to add that chunk to the Widget config when you instantiate it. Here’s what mine looks like:
var config = {
baseUrl: oktaDomain,
i18n: {
en: {
'errors.E0000114': 'A user with this Email already exists'
}
}
}
var oktaSignIn = new OktaSignIn(config);
If you are modifying the Custom Sign In page, you can instead just add the following (again, before you instantiate it:
config.i18n = {
en: {
'errors.E0000114': 'A user with this Email already exists'
}
}
// Render the Okta Sign-In Widget
var oktaSignIn = new OktaSignIn(config);
@andrea - I think if I did it that way, I would overwrite other configurations. But I am editing the config before I instantiate. I was incorrect in my original and reply post as I was misreading my own code. I edited it above to reflect the reality of what I was doing–editing the config before rendering.
As you can see from the image below, the potentially relevant properties here are being set but they are having no effect: