fix decrypt password
This commit is contained in:
@@ -7,18 +7,17 @@ import com.iconplus.smartproc.helper.model.EmptyResponse;
|
||||
import com.iconplus.smartproc.helper.service.BaseService;
|
||||
import com.iconplus.smartproc.model.entity.TokenManagement;
|
||||
import com.iconplus.smartproc.repository.TokenManagementRepository;
|
||||
import com.iconplus.smartproc.repository.UsersRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import com.iconplus.smartproc.util.Constants;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class LogoutService implements BaseService<EmptyRequest, EmptyResponse> {
|
||||
|
||||
private ApiContext apiContext;
|
||||
private TokenManagementRepository tokenManagementRepository;
|
||||
private LogoutService(ApiContext apiContext,
|
||||
|
||||
public LogoutService(ApiContext apiContext,
|
||||
TokenManagementRepository tokenManagementRepository) {
|
||||
this.apiContext = apiContext;
|
||||
this.tokenManagementRepository = tokenManagementRepository;
|
||||
@@ -35,10 +34,10 @@ public class LogoutService implements BaseService<EmptyRequest, EmptyResponse> {
|
||||
}
|
||||
|
||||
private TokenManagement getTokenManagement(String accessToken) {
|
||||
var tokenManagement = tokenManagementRepository.findByAccessTokenAndIsDeleteFalse(accessToken);
|
||||
if (tokenManagement.isEmpty()) {
|
||||
throw new BusinessException("err", "err", "err");
|
||||
}
|
||||
return tokenManagement.get();
|
||||
return tokenManagementRepository.findByAccessTokenAndIsDeleteFalse(accessToken)
|
||||
.orElseThrow(() -> new BusinessException(HttpStatus.CONFLICT,
|
||||
Constants.ERR_CODE_40038,
|
||||
Constants.ERR_TITLE_40038,
|
||||
Constants.ERR_MESSAGE_40038));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user