Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
burningtnt committed Jun 15, 2024
1 parent 15c1042 commit 85b4488
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
package org.jackhuang.hmcl.auth.microsoft;

import org.jackhuang.hmcl.auth.AuthInfo;
import org.jackhuang.hmcl.util.logging.Logger;
import org.jackhuang.hmcl.util.gson.UUIDTypeAdapter;
import org.jackhuang.hmcl.util.logging.Logger;

import java.util.Map;
import java.util.UUID;
Expand Down Expand Up @@ -87,7 +87,7 @@ public static MicrosoftSession fromStorage(Map<?, ?> storage) {
.orElseThrow(() -> new IllegalArgumentException("accessToken is missing"));
String refreshToken = tryCast(storage.get("refreshToken"), String.class)
.orElseThrow(() -> new IllegalArgumentException("refreshToken is missing"));
Long notAfter = tryCast(storage.get("notAfter"), Long.class).orElse(0L);
Long notAfter = tryCast(storage.get("notAfter"), Number.class).map(Number::longValue).orElse(0L);
String userId = tryCast(storage.get("userid"), String.class)
.orElseThrow(() -> new IllegalArgumentException("userid is missing"));
return new MicrosoftSession(tokenType, accessToken, notAfter, refreshToken, new User(userId), new GameProfile(uuid, name));
Expand Down

0 comments on commit 85b4488

Please sign in to comment.