mirror of
https://github.com/bitwarden/mobile
synced 2025-12-16 08:13:20 +00:00
Centralized logout into a message subscription in app class. Logout when API results are forbidden or unauthorized.
This commit is contained in:
@@ -56,6 +56,13 @@ namespace Bit.App.Services
|
||||
if(!cipher.Succeeded)
|
||||
{
|
||||
SyncCompleted(false);
|
||||
|
||||
if(cipher.StatusCode == System.Net.HttpStatusCode.Forbidden
|
||||
|| cipher.StatusCode == System.Net.HttpStatusCode.Unauthorized)
|
||||
{
|
||||
MessagingCenter.Send(Application.Current, "Logout", (string)null);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -136,6 +143,13 @@ namespace Bit.App.Services
|
||||
if(!ciphers.Succeeded)
|
||||
{
|
||||
SyncCompleted(false);
|
||||
|
||||
if(ciphers.StatusCode == System.Net.HttpStatusCode.Forbidden
|
||||
|| ciphers.StatusCode == System.Net.HttpStatusCode.Unauthorized)
|
||||
{
|
||||
MessagingCenter.Send(Application.Current, "Logout", (string)null);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -174,6 +188,13 @@ namespace Bit.App.Services
|
||||
if(!ciphers.Succeeded)
|
||||
{
|
||||
SyncCompleted(false);
|
||||
|
||||
if(ciphers.StatusCode == System.Net.HttpStatusCode.Forbidden
|
||||
|| ciphers.StatusCode == System.Net.HttpStatusCode.Unauthorized)
|
||||
{
|
||||
MessagingCenter.Send(Application.Current, "Logout", (string)null);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user