Skip to content

Commit

Permalink
Fix Sonar issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nqhoan-axonivy committed Jul 29, 2024
1 parent c1e3ac7 commit e9e7a42
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package com.axonivy.market.constants;

import lombok.AccessLevel;
import lombok.NoArgsConstructor;

@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class RequestParamConstants {
public static final String ID = "id";
public static final String KEY = "key";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,11 @@ public ResponseEntity<Map<String, String>> gitHubLogin(@RequestBody Oauth2Author
gitHubProperty);
accessToken = tokenResponse.getAccessToken();
} catch (Exception e) {
return new ResponseEntity<Map<String, String>>(Map.of(e.getClass().getName(), e.getMessage()),
HttpStatus.BAD_REQUEST);
return new ResponseEntity<>(Map.of(e.getClass().getName(), e.getMessage()), HttpStatus.BAD_REQUEST);
}

User user = gitHubService.getAndUpdateUser(accessToken);
String jwtToken = jwtService.generateToken(user);
return new ResponseEntity<Map<String, String>>(Collections.singletonMap(GitHubConstants.Json.TOKEN, jwtToken),
HttpStatus.OK);
return new ResponseEntity<>(Collections.singletonMap(GitHubConstants.Json.TOKEN, jwtToken), HttpStatus.OK);
}
}

0 comments on commit e9e7a42

Please sign in to comment.