diff --git a/src/App/Pages/Accounts/LoginSsoPageViewModel.cs b/src/App/Pages/Accounts/LoginSsoPageViewModel.cs index ad474820c..748ad2372 100644 --- a/src/App/Pages/Accounts/LoginSsoPageViewModel.cs +++ b/src/App/Pages/Accounts/LoginSsoPageViewModel.cs @@ -246,6 +246,7 @@ namespace Bit.App.Pages } else { + await _stateService.SetPendingAdminAuthRequestAsync(null); StartDeviceApprovalOptionsAction?.Invoke(); } } diff --git a/src/Core/Services/AuthService.cs b/src/Core/Services/AuthService.cs index 5e1248702..7b7e8ab57 100644 --- a/src/Core/Services/AuthService.cs +++ b/src/Core/Services/AuthService.cs @@ -610,8 +610,16 @@ namespace Bit.Core.Services } public async Task GetPasswordlessLoginRequestByIdAsync(string id) { - var response = await _apiService.GetAuthRequestAsync(id); - return await PopulateFingerprintPhraseAsync(response, await _stateService.GetEmailAsync()); + try + { + var response = await _apiService.GetAuthRequestAsync(id); + return await PopulateFingerprintPhraseAsync(response, await _stateService.GetEmailAsync()); + } + catch (ApiException ex) when (ex.Error?.StatusCode == System.Net.HttpStatusCode.NotFound) + { + // Thrown when request expires and purge job erases it from the db + return null; + } } ///