public async Task SignOutAsync()
{
PortalService.CurrentPortalService.SignOut();
try
{
ClearAllCredentials();
// set IsCredentialsPersisted to false
IsCredentialsPersisted = false;
}
catch (Exception ex)
{
var _ = App.ShowExceptionDialog(ex);
}
// if anonymous access is enabled go back to the main page otherwise go back to the signin page
bool isAnonymousAccess = await GetAnonymousAccessStatusAsync();
if (isAnonymousAccess)
{
(new NavigationService()).Navigate(App.MainPageName);
await SignInAnonymouslyAsync();
}
else
(new NavigationService()).Navigate(App.BlankPageName);
}