|
|
@ -90,14 +90,14 @@ public class AuthDiscordController { |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping |
|
|
|
public ResponseEntity<HashMap<String, String>> aboutMe(@CookieValue(value = "discord", defaultValue = "") String discord_token) { |
|
|
|
public ResponseEntity aboutMe(@CookieValue(value = "discord", defaultValue = "") String discord_token) { |
|
|
|
if (discord_token.isEmpty()) return ResponseEntity.status(401).build(); |
|
|
|
if (!cryptedCookie.Validate(discord_token)) return ResponseEntity.status(401).build(); |
|
|
|
String access_token = cryptedCookie.ReadCh(discord_token); |
|
|
|
return new ResponseEntity<>(getDiscordData(access_token), HttpStatus.OK); |
|
|
|
return new ResponseEntity(getDiscordData(access_token), HttpStatus.OK); |
|
|
|
} |
|
|
|
|
|
|
|
public HashMap<String, String> getDiscordData(String access_token) { |
|
|
|
public HashMap getDiscordData(String access_token) { |
|
|
|
HttpHeaders headers = new HttpHeaders(); |
|
|
|
headers.add("authorization", String.format("Bearer %s", access_token)); |
|
|
|
HttpEntity entity = new HttpEntity<>("<body>", headers); |
|
|
|