Skip to content

Commit 092cf04

Browse files
author
zhongjiahui
committed
fix: wechat login error
1 parent 70e0dbb commit 092cf04

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

guard/src/main/java/cn/authing/guard/network/AuthClient.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -654,8 +654,12 @@ public static void loginByWechatWithBind(AuthRequest authData, String authCode,
654654
body.put("code", authCode);
655655
body.put("appId", Authing.getAppId());
656656
JSONObject options = new JSONObject();
657-
options.put("scope", authData.getScope());
658-
options.put("context", context);
657+
if (authData != null){
658+
options.put("scope", authData.getScope());
659+
}
660+
if(context != null){
661+
options.put("context", context);
662+
}
659663
body.put("options", options);
660664
Guardian.post("/api/v2/ecConn/wechatMobile/authByCodeIdentity", body, (data)-> {
661665
createTokenFromResponse(data, callback);

0 commit comments

Comments
 (0)