1
0
mirror of synced 2026-04-21 08:58:37 +08:00

🔖 发布 1.15.3-alpha 解决推特登录异常的BUG

This commit is contained in:
yadong.zhang
2020-05-13 00:58:03 +08:00
parent d0ae0f2c7a
commit c6bd5d9e5d
10 changed files with 53 additions and 28 deletions

View File

@@ -72,6 +72,10 @@ public class AuthChecker {
* @since 1.8.0
*/
public static void checkCode(AuthSource source, AuthCallback callback) {
// 推特平台不支持回调 code 和 state
if (source == AuthDefaultSource.TWITTER) {
return;
}
String code = callback.getCode();
if (source == AuthDefaultSource.ALIPAY) {
code = callback.getAuth_code();
@@ -95,6 +99,10 @@ public class AuthChecker {
* @param authStateCache {@code authStateCache} state缓存实现
*/
public static void checkState(String state, AuthSource source, AuthStateCache authStateCache) {
// 推特平台不支持回调 code 和 state
if (source == AuthDefaultSource.TWITTER) {
return;
}
if (StringUtils.isEmpty(state) || !authStateCache.containsKey(state)) {
throw new AuthException(AuthResponseStatus.ILLEGAL_STATUS, source);
}