Skip to content

Instantly share code, notes, and snippets.

@mmierzwa
Last active April 24, 2017 08:16
Show Gist options
  • Save mmierzwa/a11c66cbfd13caf1aa65908c58f22ee1 to your computer and use it in GitHub Desktop.
Save mmierzwa/a11c66cbfd13caf1aa65908c58f22ee1 to your computer and use it in GitHub Desktop.
Cleaning ADAL token cache on Android and iOS
public class LoginCheckAppStart : MvxNavigatingObject, IMvxAppStart
{
private readonly IApplicationSettings _applicationSettings;
private readonly ISecureStorageService _secureStorage;
public LoginCheckAppStart(IApplicationSettings applicationSettings, ISecureStorageService secureStorage)
{
_applicationSettings = applicationSettings;
_secureStorage = secureStorage;
}
public void Start(object hint = null)
{
if (_applicationSettings.IsUserLoggingForFirstTime)
{
_secureStorage.RemoveAdalRecords();
ShowViewModel<LoginViewModel, object>(null);
}
else
{
ShowViewModel<MainViewModel, object>(null);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment