Skip to content

Commit

Permalink
feat: initialise passport
Browse files Browse the repository at this point in the history
  • Loading branch information
nattb8 committed Nov 7, 2024
1 parent 2847a65 commit 25f33e1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Assets/Shared/Scripts/UI/MainMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -78,7 +79,7 @@ void OnStartButtonClick()
AudioManager.Instance.PlayEffect(SoundID.ButtonSound);
}

void OnLogoutButtonClick()
async void OnLogoutButtonClick()
{
try
{
Expand All @@ -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;
Expand Down

0 comments on commit 25f33e1

Please sign in to comment.