From a6b26a0cd90cf0340dee00a78f77cf88b0b9ae29 Mon Sep 17 00:00:00 2001 From: huanghongxun Date: Sat, 3 Sep 2022 23:35:09 +0800 Subject: [PATCH] fix(microsoft): show relogin dialog when grant expired. Closes #1691. --- HMCLCore/src/main/java/org/jackhuang/hmcl/auth/OAuth.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/auth/OAuth.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/auth/OAuth.java index f81e2b345..fd3825a10 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/auth/OAuth.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/auth/OAuth.java @@ -181,7 +181,8 @@ public class OAuth { switch (response.error) { case "invalid_grant": - if (response.errorDescription.contains("The user must sign in again and if needed grant the client application access to the requested scope")) { + if (response.errorDescription.contains("The user must sign in again and if needed grant the client application access to the requested scope") || + response.errorDescription.contains("The user could not be authenticated as the grant is expired")) { throw new CredentialExpiredException(); } break;