Skip to content
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

Merged
merged 4 commits into from
Mar 18, 2024

Conversation

wieczorslawo
Copy link
Contributor

No description provided.

@wieczorslawo wieczorslawo requested review from nschmid and ramich March 7, 2024 12:50
// 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));
Copy link
Contributor

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(),
Copy link
Contributor

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?

Copy link
Contributor Author

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)

@wieczorslawo wieczorslawo requested a review from ramich March 15, 2024 15:49
@wieczorslawo wieczorslawo merged commit c6fecae into develop Mar 18, 2024
@wieczorslawo wieczorslawo deleted the bugfix/HELLODATA-1295_409_error branch March 18, 2024 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants