From 25f33e186d6813f62714f495be22c7bd51b00d0e Mon Sep 17 00:00:00 2001 From: Natalie Bunduwongse Date: Fri, 23 Feb 2024 10:39:57 +1300 Subject: [PATCH] feat: initialise passport --- Assets/Shared/Scripts/UI/MainMenu.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Assets/Shared/Scripts/UI/MainMenu.cs b/Assets/Shared/Scripts/UI/MainMenu.cs index 306cc6e9..0bf1e916 100644 --- a/Assets/Shared/Scripts/UI/MainMenu.cs +++ b/Assets/Shared/Scripts/UI/MainMenu.cs @@ -64,7 +64,8 @@ async void OnEnable() } ShowLoading(false); - ShowStartButton(true); + // Show the logout button if the player is logged in + ShowLogoutButton(SaveManager.Instance.IsLoggedIn); } void OnDisable() @@ -78,7 +79,7 @@ void OnStartButtonClick() AudioManager.Instance.PlayEffect(SoundID.ButtonSound); } - void OnLogoutButtonClick() + async void OnLogoutButtonClick() { try { @@ -88,6 +89,11 @@ void OnLogoutButtonClick() ShowLoading(true); // Logout +#if (UNITY_ANDROID && !UNITY_EDITOR_WIN) || (UNITY_IPHONE && !UNITY_EDITOR_WIN) || UNITY_STANDALONE_OSX + await passport.LogoutPKCE(); +#else + await passport.Logout(); +#endif // Reset the login flag SaveManager.Instance.IsLoggedIn = false;