src/main/java/com/property/manager/data/service/AuthService.java
public ResponseEntity<?> login(AuthRequestDTO authRequestDTO) {
        ClientEntity clientEntity = clientRepository.findByUsernameAndRemovedIsFalse(authRequestDTO.getUsername());

        if (!new BCryptPasswordEncoder().matches(authRequestDTO.getPassword(), clientEntity.getPassword()))
            return new ResponseEntity<>(
                    messageSource.getMessage(incorrect_username_or_password, null, null), HttpStatus.UNAUTHORIZED);

        String token = jwtTokenProvider.createToken(clientEntity.getUsername(), clientEntity.getCreatedAt());
        String refreshToken = jwtTokenProvider.refreshToken(clientEntity.getUsername(), clientEntity.getCreatedAt());
        refreshTokens.put(refreshToken, authRequestDTO.getUsername());
        AuthResponseDTO authResponseDTO = new AuthResponseDTO(token, refreshToken);
        return new ResponseEntity<>(authResponseDTO, HttpStatus.OK);
    }
/**
     * Login to platform
     *
     * @param authRequestDTO DTO object
     * @return ResponseEntity object, with
     * - OK status code and AuthDTO object or error message
     */
Login to platform
@param authRequestDTO DTO object
@return ResponseEntity object, with
- OK status code and AuthDTO object or error message
Login to platform @param authRequestDTO DTO object @return ResponseEntity object with - OK status code and AuthDTO object or error message
public ResponseEntity<?> login(AuthRequestDTO authRequestDTO) {
        ClientEntity clientEntity = clientRepository.findByUsernameAndRemovedIsFalse(authRequestDTO.getUsername());
        if (!new BCryptPasswordEncoder().matches(authRequestDTO.getPassword(), clientEntity.getPassword()))
            return new ResponseEntity<>(
                    messageSource.getMessage(incorrect_username_or_password, null, null), HttpStatus.UNAUTHORIZED);
        String token = jwtTokenProvider.createToken(clientEntity.getUsername(), clientEntity.getCreatedAt());
        String refreshToken = jwtTokenProvider.refreshToken(clientEntity.getUsername(), clientEntity.getCreatedAt());
        refreshTokens.put(refreshToken, authRequestDTO.getUsername());
        AuthResponseDTO authResponseDTO = new AuthResponseDTO(token, refreshToken);
        return new ResponseEntity<>(authResponseDTO, HttpStatus.OK);
    }
public ResponseEntity < ? > login ( AuthRequestDTO authRequestDTO ) { ClientEntity clientEntity = clientRepository . findByUsernameAndRemovedIsFalse ( authRequestDTO . getUsername ( ) ) ; if ( ! new BCryptPasswordEncoder ( ) . matches ( authRequestDTO . getPassword ( ) , clientEntity . getPassword ( ) ) ) return new ResponseEntity < > ( messageSource . getMessage ( incorrect_username_or_password , null , null ) , HttpStatus . UNAUTHORIZED ) ; String token = jwtTokenProvider . createToken ( clientEntity . getUsername ( ) , clientEntity . getCreatedAt ( ) ) ; String refreshToken = jwtTokenProvider . refreshToken ( clientEntity . getUsername ( ) , clientEntity . getCreatedAt ( ) ) ; refreshTokens . put ( refreshToken , authRequestDTO . getUsername ( ) ) ; AuthResponseDTO authResponseDTO = new AuthResponseDTO ( token , refreshToken ) ; return new ResponseEntity < > ( authResponseDTO , HttpStatus . OK ) ; }
Login to platform
 @param authRequestDTO DTO object
 @return ResponseEntity object, with
 - OK status code and AuthDTO object or error message
Login to platform @param authRequestDTO DTO object @return ResponseEntity object with - OK status code and AuthDTO object or error message