1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-06 10:34:07 +00:00

[SG-834] Mobile pending login requests management screen (#2281)

* Bootstrap new classes for settings list

* [SG-834] Add new method GetActivePasswordlessLoginRequestsAsync to AuthService

* [SG-834] Add generic handle exception method to BaseViewModel

* [SG-834] Add request verification to settings entry

* [SG-834] Add text resources

* [SG-834] Update view and viewmodel

* [SG-834] Remove unnecessary property assignment

* [SG-834] removed logger resolve
This commit is contained in:
André Bispo
2023-02-01 12:22:17 +00:00
committed by GitHub
parent c3ad5f0580
commit e61ca489ce
10 changed files with 395 additions and 5 deletions

View File

@@ -30,6 +30,7 @@ namespace Bit.Core.Abstractions
Task<AuthResult> LogInPasswordlessAsync(string email, string accessCode, string authRequestId, byte[] decryptionKey, string userKeyCiphered, string localHashedPasswordCiphered);
Task<List<PasswordlessLoginResponse>> GetPasswordlessLoginRequestsAsync();
Task<List<PasswordlessLoginResponse>> GetActivePasswordlessLoginRequestsAsync();
Task<PasswordlessLoginResponse> GetPasswordlessLoginRequestByIdAsync(string id);
Task<PasswordlessLoginResponse> GetPasswordlessLoginResponseAsync(string id, string accessCode);
Task<PasswordlessLoginResponse> PasswordlessLoginAsync(string id, string pubKey, bool requestApproved);

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Bit.Core.Abstractions;
@@ -494,6 +495,12 @@ namespace Bit.Core.Services
return await _apiService.GetAuthRequestAsync();
}
public async Task<List<PasswordlessLoginResponse>> GetActivePasswordlessLoginRequestsAsync()
{
var requests = await GetPasswordlessLoginRequestsAsync();
return requests.Where(r => !r.IsAnswered && !r.IsExpired).OrderByDescending(r => r.CreationDate).ToList();
}
public async Task<PasswordlessLoginResponse> GetPasswordlessLoginRequestByIdAsync(string id)
{
return await _apiService.GetAuthRequestAsync(id);