auth: Always check token.exp when launch game (#2642)
* auth: Always check token.exp when launch game fix #2048 * Remove wrong notAfter check
This commit is contained in:
@@ -84,20 +84,16 @@ public class MicrosoftAccount extends OAuthAccount {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AuthInfo logIn() throws AuthenticationException {
|
public AuthInfo logIn() throws AuthenticationException {
|
||||||
if (!authenticated) {
|
if (!authenticated || !service.validate(session.getNotAfter(), session.getTokenType(), session.getAccessToken())) {
|
||||||
if (service.validate(session.getNotAfter(), session.getTokenType(), session.getAccessToken())) {
|
MicrosoftSession acquiredSession = service.refresh(session);
|
||||||
authenticated = true;
|
if (!Objects.equals(acquiredSession.getProfile().getId(), session.getProfile().getId())) {
|
||||||
} else {
|
throw new ServerResponseMalformedException("Selected profile changed");
|
||||||
MicrosoftSession acquiredSession = service.refresh(session);
|
|
||||||
if (!Objects.equals(acquiredSession.getProfile().getId(), session.getProfile().getId())) {
|
|
||||||
throw new ServerResponseMalformedException("Selected profile changed");
|
|
||||||
}
|
|
||||||
|
|
||||||
session = acquiredSession;
|
|
||||||
|
|
||||||
authenticated = true;
|
|
||||||
invalidate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
session = acquiredSession;
|
||||||
|
|
||||||
|
authenticated = true;
|
||||||
|
invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
return session.toAuthInfo();
|
return session.toAuthInfo();
|
||||||
|
|||||||
Reference in New Issue
Block a user