mirror of
https://github.com/bitwarden/mobile
synced 2026-01-10 12:33:28 +00:00
fix error when login token expires
This commit is contained in:
@@ -97,7 +97,8 @@ namespace Bit.App
|
||||
}
|
||||
else if(message.Command == "logout")
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(async () => await LogOutAsync(false));
|
||||
Device.BeginInvokeOnMainThread(async () =>
|
||||
await LogOutAsync((message.Data as bool?).GetValueOrDefault()));
|
||||
}
|
||||
else if(message.Command == "loggedOut")
|
||||
{
|
||||
@@ -240,6 +241,10 @@ namespace Bit.App
|
||||
_authService.LogOut(() =>
|
||||
{
|
||||
Current.MainPage = new HomePage();
|
||||
if(expired)
|
||||
{
|
||||
_platformUtilsService.ShowToast("warning", null, AppResources.LoginExpired);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -456,7 +456,10 @@ namespace Bit.App.Pages
|
||||
catch(ApiException e)
|
||||
{
|
||||
await _deviceActionService.HideLoadingAsync();
|
||||
await Page.DisplayAlert(AppResources.AnErrorHasOccurred, e.Error.GetSingleMessage(), AppResources.Ok);
|
||||
if(e?.Error != null)
|
||||
{
|
||||
await Page.DisplayAlert(AppResources.AnErrorHasOccurred, e.Error.GetSingleMessage(), AppResources.Ok);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
9
src/App/Resources/AppResources.Designer.cs
generated
9
src/App/Resources/AppResources.Designer.cs
generated
@@ -2274,6 +2274,15 @@ namespace Bit.App.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Your login session has expired..
|
||||
/// </summary>
|
||||
public static string LoginExpired {
|
||||
get {
|
||||
return ResourceManager.GetString("LoginExpired", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Login.
|
||||
/// </summary>
|
||||
|
||||
@@ -1575,4 +1575,7 @@
|
||||
<data name="ToggleVisibility" xml:space="preserve">
|
||||
<value>Toggle Visibility</value>
|
||||
</data>
|
||||
<data name="LoginExpired" xml:space="preserve">
|
||||
<value>Your login session has expired.</value>
|
||||
</data>
|
||||
</root>
|
||||
Reference in New Issue
Block a user