diff --git a/errormessages.go b/errormessages.go index ed56fae..4b9c8c8 100644 --- a/errormessages.go +++ b/errormessages.go @@ -22,4 +22,5 @@ const ( OIDCProvider = "OIDCProvider" UserOrEmail = "UsernameOrEmail" Username = "username" + Email = "email" ) diff --git a/keycloak_client.go b/keycloak_client.go index 861accc..0aa6ddd 100644 --- a/keycloak_client.go +++ b/keycloak_client.go @@ -407,8 +407,8 @@ func whitelistErrors(statusCode int, message string) error { "User exists with same username or email": MsgErrExistingValue + "." + UserOrEmail, "usernameExistsMessage": MsgErrExistingValue + "." + UserOrEmail, "emailExistsMessage": MsgErrExistingValue + "." + UserOrEmail, - "Username exists with same username": MsgErrExistingValue + "." + UserOrEmail, - "Username exists with same email": MsgErrExistingValue + "." + UserOrEmail, + "Username exists with same username": MsgErrExistingValue + "." + Username, + "Username exists with same email": MsgErrExistingValue + "." + Email, "readOnlyUsernameMessage": MsgErrReadOnly + "." + Username, }