Skip to content

Commit

Permalink
Fixed registration bug (#337)
Browse files Browse the repository at this point in the history
* Fixed registration bug

* Linting

* Removed empty line
  • Loading branch information
adrianwium authored Nov 22, 2023
1 parent d8ab2e5 commit b2d4db5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/api/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ services:

keycloak: # Local Keycloak server
# https://github.com/adorsys/keycloak-config-cli/pull/928
image: quay.io/keycloak/keycloak:22.0.3
image: quay.io/keycloak/keycloak:22.0.1
container_name: keycloak
environment:
WEBHOOK_EVENTS_TAKEN: "LOGIN,REGISTER,LOGOUT,UPDATE_PROFILE"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private async Task UpdateUserProfile(WebhookRequestEventType type, KeycloakWebho
userRequest = new UserRequest();
}

userRequest.Email = kcUser.Email.Trim();
userRequest.Email = kcUser.Username.Trim();
userRequest.FirstName = kcUser.FirstName.Trim();
userRequest.Surname = kcUser.LastName.Trim();
userRequest.EmailConfirmed = kcUser.EmailVerified;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ public async Task<User> Upsert(UserRequest request)
// profile fields updatable via UserProfileService.Update; identity provider is source of truth
if (isNew)
{
var kcUser = await _identityProviderClient.GetUser(result.Email)
?? throw new InvalidOperationException($"{nameof(User)} with email '{result.Email}' does not exist");
var kcUser = await _identityProviderClient.GetUser(request.Email)
?? throw new InvalidOperationException($"{nameof(User)} with email '{request.Email}' does not exist");
result.Email = request.Email;
result.FirstName = request.FirstName;
result.Surname = request.Surname;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public class Details
public string auth_method { get; set; }
public string auth_type { get; set; }
public string redirect_uri { get; set; }
public string consent { get; set; }
public string code_id { get; set; }
public string username { get; set; }
}
Expand Down

0 comments on commit b2d4db5

Please sign in to comment.