Skip to content

Commit

Permalink
[ANY] Use query helper in Microsoft auth module (#87)
Browse files Browse the repository at this point in the history
Co-authored-by: d3coder <admin@xakeps.dk>
  • Loading branch information
XakepSDK and d3coder committed Apr 3, 2024
1 parent 6bbd3dd commit dba18b5
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -11,6 +11,8 @@
import pro.gravit.launcher.base.request.auth.password.AuthCodePassword;
import pro.gravit.launchserver.LaunchServer;
import pro.gravit.launchserver.auth.AuthException;
import pro.gravit.utils.helper.CommonHelper;
import pro.gravit.utils.helper.QueryHelper;
import pro.gravit.launchserver.auth.core.UserSession;
import pro.gravit.launchserver.helper.HttpHelper;
import pro.gravit.launchserver.manangers.AuthManager;
Expand Down Expand Up @@ -76,7 +78,9 @@ public AuthManager.AuthReport authorize(String login, AuthResponse.AuthContext c
throw AuthException.wrongPassword();
}
AuthCodePassword codePassword = (AuthCodePassword) password;
var code = codePassword.code;
var uri = URI.create(codePassword.uri);
var queries = QueryHelper.splitUriQuery(uri);
var code = CommonHelper.multimapFirstOrNullValue("code", queries);
try {
var token = sendMicrosoftOAuthTokenRequest(code);
if (token == null) {
Expand Down

0 comments on commit dba18b5

Please sign in to comment.