Skip to content

Commit

Permalink
fix: password not setting
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilczaja committed Dec 12, 2024
1 parent a11e94c commit 6a0ca10
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,23 +141,15 @@ class KeycloakService(
}

if (password != null && user.credentials != null) {
user.credentials.remove(
user.credentials.firstOrNull { it.type == CredentialRepresentation.PASSWORD }
)
user.credentials.add(
keycloak.realm(keycloakRealm).users().get(userId).resetPassword(
CredentialRepresentation().also { credentials ->
credentials.isTemporary = false
credentials.type = CredentialRepresentation.PASSWORD
credentials.value = password
}
)
}

if (user.email != email || password != null) {
forceLogout(userId)
}
}

keycloak.realm(keycloakRealm).users().get(userId).update(user)
}

Expand Down

0 comments on commit 6a0ca10

Please sign in to comment.