mirror of
https://github.com/bitwarden/server.git
synced 2025-07-04 01:22:50 -05:00
move some 2fa logic functions to userService
This commit is contained in:
@ -307,7 +307,7 @@ namespace Bit.Api.Controllers
|
||||
var organizationUserDetails = await _organizationUserRepository.GetManyDetailsByUserAsync(user.Id,
|
||||
OrganizationUserStatusType.Confirmed);
|
||||
var response = new ProfileResponseModel(user, organizationUserDetails,
|
||||
await user.TwoFactorIsEnabledAsync(_userService));
|
||||
await _userService.TwoFactorIsEnabledAsync(user));
|
||||
return response;
|
||||
}
|
||||
|
||||
@ -332,7 +332,7 @@ namespace Bit.Api.Controllers
|
||||
}
|
||||
|
||||
await _userService.SaveUserAsync(model.ToUser(user));
|
||||
var response = new ProfileResponseModel(user, null, await user.TwoFactorIsEnabledAsync(_userService));
|
||||
var response = new ProfileResponseModel(user, null, await _userService.TwoFactorIsEnabledAsync(user));
|
||||
return response;
|
||||
}
|
||||
|
||||
@ -462,7 +462,7 @@ namespace Bit.Api.Controllers
|
||||
|
||||
await _userService.SignUpPremiumAsync(user, model.PaymentToken,
|
||||
model.AdditionalStorageGb.GetValueOrDefault(0), license);
|
||||
return new ProfileResponseModel(user, null, await user.TwoFactorIsEnabledAsync(_userService));
|
||||
return new ProfileResponseModel(user, null, await _userService.TwoFactorIsEnabledAsync(user));
|
||||
}
|
||||
|
||||
[HttpGet("billing")]
|
||||
|
@ -69,7 +69,7 @@ namespace Bit.Api.Controllers
|
||||
collectionCiphersGroupDict = collectionCiphers.GroupBy(c => c.CipherId).ToDictionary(s => s.Key);
|
||||
}
|
||||
|
||||
var userTwoFactorEnabled = await user.TwoFactorIsEnabledAsync(_userService);
|
||||
var userTwoFactorEnabled = await _userService.TwoFactorIsEnabledAsync(user);
|
||||
var response = new SyncResponseModel(_globalSettings, user, userTwoFactorEnabled, organizationUserDetails,
|
||||
folders, collections, ciphers, collectionCiphersGroupDict, excludeDomains);
|
||||
return response;
|
||||
|
Reference in New Issue
Block a user