From c896329a449045e3def2ff05ca801ec8e1b4a480 Mon Sep 17 00:00:00 2001 From: syeyoung Date: Thu, 17 Nov 2022 01:38:48 +0900 Subject: - Fix Privacy token getting changed with FailedAuthToken Signed-off-by: syeyoung --- .../java/kr/syeyoung/dungeonsguide/launcher/auth/AuthManager.java | 4 ++-- .../syeyoung/dungeonsguide/launcher/gui/screen/GuiPrivacyPolicy.java | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'loader/src/main/java/kr/syeyoung') diff --git a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/auth/AuthManager.java b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/auth/AuthManager.java index 2dea4bdf..206ed0fb 100644 --- a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/auth/AuthManager.java +++ b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/auth/AuthManager.java @@ -110,7 +110,6 @@ public class AuthManager { NotificationManager.INSTANCE.removeNotification(authenticationFailure); NotificationManager.INSTANCE.removeNotification(privacyPolicyRequired); } catch (Exception e) { - currentToken = new FailedAuthToken(e); if (e instanceof PrivacyPolicyRequiredException) { NotificationManager.INSTANCE.updateNotification(authenticationFailure, Notification.builder() .title("Privacy Policy") @@ -122,6 +121,7 @@ public class AuthManager { }) .build()); } else { + currentToken = new FailedAuthToken(e); NotificationManager.INSTANCE.updateNotification(authenticationFailure, Notification.builder() .title("Auth Error") .description("Authentication Error Occured\n"+e.getMessage()) @@ -153,7 +153,6 @@ public class AuthManager { currentToken = DgAuthUtil.acceptNewPrivacyPolicy(currentToken.getToken()); if (currentToken instanceof PrivacyPolicyRequiredToken) throw new PrivacyPolicyRequiredException(); } catch (Exception e) { - currentToken = new FailedAuthToken(e); if (e instanceof PrivacyPolicyRequiredException) { NotificationManager.INSTANCE.updateNotification(authenticationFailure, Notification.builder() .title("Privacy Policy") @@ -165,6 +164,7 @@ public class AuthManager { }) .build()); } else { + currentToken = new FailedAuthToken(e); NotificationManager.INSTANCE.updateNotification(authenticationFailure, Notification.builder() .title("Auth Error") .description("Authentication Error Occured\n"+e.getMessage()) diff --git a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/gui/screen/GuiPrivacyPolicy.java b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/gui/screen/GuiPrivacyPolicy.java index 72d08cea..c5a1ea00 100644 --- a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/gui/screen/GuiPrivacyPolicy.java +++ b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/gui/screen/GuiPrivacyPolicy.java @@ -29,6 +29,7 @@ public class GuiPrivacyPolicy extends SpecialGuiScreen { try { AuthManager.getInstance().acceptPrivacyPolicy(); } catch (PrivacyPolicyRequiredException e) { + e.printStackTrace(); // GuiDisplayer.INSTANCE.displayGui(new GuiLoadingError(e)); // display tooltip. } -- cgit