MLC-252/add client and agent registration,login and logout with Keycloak integration
Fusionnées MLC-252/add client and agent registration,login and logout with Keycloak integration
feature/MLC-252
dans
develop
3 fils de conversation non résolus
3 fils de conversation non résolus
Closes MLC-252
Rapports de requête de fusion
Activité
Filtrer l'activité
113 "AGENT_DO" // role 114 ); 115 116 authService.registerUser(requestKeycloak); 117 118 111 119 } catch (Exception e) { 112 log.error("Erreur lors de l'inscription dans Keycloak : {}", e.getMessage()); 120 log.error("Erreur lors de l'inscription dans Keycloak", e); // Affiche toute l'erreur 121 throw new TechnicalException("Erreur Keycloak"); // optionnel : relancer une exception pour forcer l'échec 113 122 } 114 123 115 124 Agent savedAgent = agentRepository.save(agent); 116 125 117 return agentMapper.toDto(savedAgent); 126 // return agentMapper.toDto(savedAgent); changed this line in version 2 of the diff
42 case ACTIVE -> { 43 return tryLogin(request); 44 } 45 case PENDING -> { 46 user.setStatus(UserStatus.ACTIVE); 47 userRepository.save(user); 48 return tryLogin(request); 49 } 50 case BANNED -> throw new FunctionalException(Message.ACCOUNT_BANNED); 51 case REJECTED -> throw new FunctionalException(Message.ACCOUNT_REJECTED); 52 default -> throw new FunctionalException(Message.USER_STATUS_NOT_RECOGNIZED); 53 } 54 } 55 56 57 private AuthenticationResponse tryLogin(AuthenticationRequest request) changed this line in version 2 of the diff
49 } 50 case BANNED -> throw new FunctionalException(Message.ACCOUNT_BANNED); 51 case REJECTED -> throw new FunctionalException(Message.ACCOUNT_REJECTED); 52 default -> throw new FunctionalException(Message.USER_STATUS_NOT_RECOGNIZED); 53 } 54 } 55 56 57 private AuthenticationResponse tryLogin(AuthenticationRequest request) 58 throws FunctionalException, TechnicalException { 59 try { 60 61 AuthenticationResponse response = authService.getToken(request); 62 63 if (response == null || response.token() == null) { 64 throw new TechnicalException("Token non généré, credentials invalides."); changed this line in version 2 of the diff
mentioned in commit d1a7531e
Veuillez vous inscrire ou vous connecter pour répondre