Skip to content

Commit

Permalink
change manner (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanmomo committed May 5, 2024
1 parent 3e93bef commit 206139a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public void twitterOauthLogin(@RequestParam(name = "test", defaultValue = "false
.toUriString());
}

@PostMapping("/oauth2/callback/discord")
public BaseResponse getTwitter(@RequestParam("code") String code, @RequestParam(required = false) String addressForTesting,
@PostMapping("oauth2/callback/discord")
public BaseResponse discordCallback(@RequestParam("code") String code, @RequestParam(required = false) String addressForTesting,
HttpSession session) {
// 检查用户是否注册
SessionUserInfo sessionUserInfo = HttpSessionUtils.getMember(session);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class TelegramOAuthController {

private TwitterConnectionFactory connectionFactory = null;

@PostMapping("/oauth2/callback/telegram")
@PostMapping("oauth2/callback/telegram")
public BaseResponse verifyTelegram(@RequestParam Map<String, String> params, @RequestParam(required = false) String addressForTesting,
HttpSession session) {
SessionUserInfo sessionUserInfo = HttpSessionUtils.getMember(session);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class TwitterController {
@Autowired
private TwitterOAuthConfig twitterOAuthConfig;

@GetMapping("/oauth2/authorize/normal/twitter")
@GetMapping("oauth2/authorize/normal/twitter")
public void twitterOauthLogin(@RequestParam(name = "test", defaultValue = "false") boolean test, HttpServletResponse response)
throws IOException {
String authorizeUrl = this.generateAuthorizeUrl(test);
Expand All @@ -56,7 +56,7 @@ private String generateAuthorizeUrl(boolean test) {
return oauthOperations.buildAuthorizeUrl(requestToken.getValue(), oAuth1Parameters);
}

@GetMapping("/oauth2/callback/twitter")
@GetMapping("oauth2/callback/twitter")
public BaseResponse getTwitter(@RequestParam("oauth_token") String oauthToken, @RequestParam("oauth_verifier") String oauthVerifier,
@RequestParam(value = "secret", required = false) String secret, HttpServletRequest request) {
Pair<String, String> twitterUserNameAndScreenName = fetchProfile(oauthToken, oauthVerifier, secret);
Expand Down

0 comments on commit 206139a

Please sign in to comment.