Skip to content

Commit

Permalink
[docker build] Change the header, need check
Browse files Browse the repository at this point in the history
  • Loading branch information
euskalhenriko committed Feb 12, 2025
1 parent 23f6ecc commit b9ab23a
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,12 @@ private Session activeSession(HubUserProfile profile, String token) {
private ResponseEntity<HubLoginResponse> hubLogin(UserAuthenticationRequest login) {
HttpHeaders headers = new HttpHeaders();
String authorization = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()
.getHeader("Authorization");
.getHeader("klab-authorization");

if (authorization != null) {

headers.add("Authorization", ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()
.getHeader("Authorization"));
headers.add("klab-authorization", ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()
.getHeader("klab-authorization"));
}

HttpEntity< ? > request = new HttpEntity<>(login, headers);
Expand All @@ -290,17 +290,17 @@ private ResponseEntity<HubLoginResponse> hubLogin(UserAuthenticationRequest logi
private URI hubLogout(String token) {
HttpHeaders headers = new HttpHeaders();
headers.add("Authentication", token);
headers.add("Authorization",
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest().getHeader("Authorization"));
headers.add("klab-authorization",
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest().getHeader("klab-authorization"));
HttpEntity< ? > request = new HttpEntity<>(headers);
return restTemplate.postForLocation(getLogOutUrll(), request);
}

private ResponseEntity<HubUserProfile> hubToken(String token) {
HttpHeaders headers = new HttpHeaders();
headers.add("Authentication", token);
headers.add("Authorization",
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest().getHeader("Authorization"));
headers.add("klab-authorization",
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest().getHeader("klab-authorization"));
HttpEntity< ? > request = new HttpEntity<>(headers);
ResponseEntity<HubUserProfile> response = restTemplate.exchange(getProfileUrl(), HttpMethod.GET, request,
HubUserProfile.class, true);
Expand Down

0 comments on commit b9ab23a

Please sign in to comment.