提交 eb059d03 编写于 作者: 智布道's avatar 智布道 👁

👽 Updating code due to external API changes.

上级 bde6544e
...@@ -68,10 +68,11 @@ public interface JapUserService { ...@@ -68,10 +68,11 @@ public interface JapUserService {
* <p> * <p>
* It is suitable for the {@code jap-oauth2} module * It is suitable for the {@code jap-oauth2} module
* *
* @param platform oauth2 platform name
* @param userInfo The basic user information returned by the OAuth platform * @param userInfo The basic user information returned by the OAuth platform
* @return When saving successfully, return {@code JapUser}, otherwise return {@code null} * @return When saving successfully, return {@code JapUser}, otherwise return {@code null}
*/ */
default JapUser createAndGetOauth2User(JSONObject userInfo) { default JapUser createAndGetOauth2User(String platform, JSONObject userInfo) {
throw new JapUserException("JapUserService#createAndGetOauth2User(JSONObject) must be overridden by subclass"); throw new JapUserException("JapUserService#createAndGetOauth2User(JSONObject) must be overridden by subclass");
} }
......
...@@ -95,7 +95,7 @@ public class Oauth2Strategy extends AbstractJapStrategy { ...@@ -95,7 +95,7 @@ public class Oauth2Strategy extends AbstractJapStrategy {
throw new JapOauth2Exception("Oauth2Strategy failed to get userinfo with accessToken." + throw new JapOauth2Exception("Oauth2Strategy failed to get userinfo with accessToken." +
userinfo.getString("error_description") + " " + userinfoResponse); userinfo.getString("error_description") + " " + userinfoResponse);
} }
JapUser japUser = this.japUserService.createAndGetOauth2User(userinfo); JapUser japUser = this.japUserService.createAndGetOauth2User(oAuthConfig.getPlatform(), userinfo);
if (ObjectUtil.isNull(japUser)) { if (ObjectUtil.isNull(japUser)) {
throw new JapUserException("Unable to save user information"); throw new JapUserException("Unable to save user information");
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册