mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-06-09 11:39:31 +08:00
fix: include twitter client secret
This commit is contained in:
@@ -28,6 +28,9 @@ public class TwitterAuthService {
|
|||||||
@Value("${twitter.client-id:}")
|
@Value("${twitter.client-id:}")
|
||||||
private String clientId;
|
private String clientId;
|
||||||
|
|
||||||
|
@Value("${twitter.client-secret:}")
|
||||||
|
private String clientSecret;
|
||||||
|
|
||||||
public Optional<User> authenticate(
|
public Optional<User> authenticate(
|
||||||
String code,
|
String code,
|
||||||
String codeVerifier,
|
String codeVerifier,
|
||||||
@@ -50,7 +53,9 @@ public class TwitterAuthService {
|
|||||||
body.add("code_verifier", codeVerifier);
|
body.add("code_verifier", codeVerifier);
|
||||||
body.add("redirect_uri", redirectUri); // 一律必填
|
body.add("redirect_uri", redirectUri); // 一律必填
|
||||||
// 如果你的 app 属于机密客户端,必须带 client_secret
|
// 如果你的 app 属于机密客户端,必须带 client_secret
|
||||||
// body.add("client_secret", clientSecret);
|
if (clientSecret != null && !clientSecret.isBlank()) {
|
||||||
|
body.add("client_secret", clientSecret);
|
||||||
|
}
|
||||||
|
|
||||||
ResponseEntity<JsonNode> tokenRes;
|
ResponseEntity<JsonNode> tokenRes;
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user