mirror of
https://github.com/bitwarden/mobile
synced 2026-01-09 20:13:18 +00:00
[AC-1070] Add optional ForcePasswordResetReason to profile / state service
This commit is contained in:
@@ -1040,6 +1040,22 @@ namespace Bit.Core.Services
|
||||
await SetValueAsync(Constants.UsesKeyConnectorKey(reconciledOptions.UserId), value, reconciledOptions);
|
||||
}
|
||||
|
||||
public async Task<ForcePasswordResetReason?> GetForcePasswordResetReasonAsync(string userId = null)
|
||||
{
|
||||
var reconcileOptions = ReconcileOptions(new StorageOptions { UserId = userId },
|
||||
await GetDefaultStorageOptionsAsync());
|
||||
return (await GetAccountAsync(reconcileOptions))?.Profile?.ForcePasswordResetReason;
|
||||
}
|
||||
|
||||
public async Task SetForcePasswordResetReasonAsync(ForcePasswordResetReason? value, string userId = null)
|
||||
{
|
||||
var reconcileOptions = ReconcileOptions(new StorageOptions { UserId = userId },
|
||||
await GetDefaultStorageOptionsAsync());
|
||||
var account = await GetAccountAsync(reconcileOptions);
|
||||
account.Profile.ForcePasswordResetReason = value;
|
||||
await SaveAccountAsync(account, reconcileOptions);
|
||||
}
|
||||
|
||||
public async Task<Dictionary<string, OrganizationData>> GetOrganizationsAsync(string userId = null)
|
||||
{
|
||||
var reconciledOptions = ReconcileOptions(new StorageOptions { UserId = userId },
|
||||
|
||||
Reference in New Issue
Block a user