-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HELLODATA-1295 - starting portal may result 409 fix #50
Conversation
...i/src/main/java/ch/bedag/dap/hellodata/portal/initialize/service/DefaultUserInitializer.java
Outdated
Show resolved
Hide resolved
// Check if the default user exists in Keycloak | ||
boolean userExistsInKeycloak = getAllUsersFromKeycloak().stream().anyMatch(user -> user.getEmail().equals(defaultAdminProperties.getEmail())); | ||
boolean userExistsInKeycloak = allUsersFromKeycloak.stream().anyMatch(user -> user.getEmail().equals(email)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't you use here userByEmail.exists() (or if not, adjust to equalsIgnoreCase, like above)?
|
||
//different email but duplicated username | ||
if (!userByUsername.get().getEmail().equalsIgnoreCase(email)) { | ||
defaultUsersInitiated = createDefaultAdmin(userByUsername.get().getUsername(), defaultAdminProperties.getFirstName(), defaultAdminProperties.getLastName(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this create an exception upon calling createUserInKeycloak() as this user already exists in KC?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes i does and it's good, now we'll have more logs to see where the problem is (most likely bad config)
No description provided.