Skip to content

Commit

Permalink
Merge pull request #498 from credebl/user-keycloak-fixes
Browse files Browse the repository at this point in the history
fix: user registration for keycloak
  • Loading branch information
nishad-ayanworks authored Feb 9, 2024
2 parents 17d791f + 9c2f0c8 commit e309574
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/user/src/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ export class UserService {
if (!checkUserDetails) {
throw new NotFoundException(ResponseMessages.user.error.emailIsNotVerified);
}
if (checkUserDetails.supabaseUserId) {
if (checkUserDetails.keycloakUserId) {
throw new ConflictException(ResponseMessages.user.error.exists);
}
if (false === checkUserDetails.isEmailVerified) {
Expand Down Expand Up @@ -972,7 +972,7 @@ export class UserService {
const userDetails = await this.userRepository.checkUniqueUserExist(email.toLowerCase());
if (userDetails && !userDetails.isEmailVerified) {
throw new ConflictException(ResponseMessages.user.error.verificationAlreadySent);
} else if (userDetails && userDetails.supabaseUserId) {
} else if (userDetails && userDetails.keycloakUserId) {
throw new ConflictException(ResponseMessages.user.error.exists);
} else if (null === userDetails) {
return {
Expand All @@ -983,7 +983,7 @@ export class UserService {
const userVerificationDetails = {
isEmailVerified: userDetails.isEmailVerified,
isFidoVerified: userDetails.isFidoVerified,
isRegistrationCompleted: null !== userDetails.supabaseUserId && undefined !== userDetails.supabaseUserId
isRegistrationCompleted: null !== userDetails.keycloakUserId && undefined !== userDetails.keycloakUserId

};
return userVerificationDetails;
Expand Down

0 comments on commit e309574

Please sign in to comment.