1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 23:52:50 -05:00

Make WebAuthn a Free Method (#3217)

* make webauthn method free

* flip premium params

* remove premium checks
This commit is contained in:
rr-bw
2023-08-31 11:25:23 -07:00
committed by GitHub
parent ba53208c93
commit 6db02e2e5c
3 changed files with 5 additions and 14 deletions

View File

@ -236,7 +236,7 @@ public class TwoFactorController : Controller
[HttpPost("get-webauthn")]
public async Task<TwoFactorWebAuthnResponseModel> GetWebAuthn([FromBody] SecretVerificationRequestModel model)
{
var user = await CheckAsync(model, true);
var user = await CheckAsync(model, false);
var response = new TwoFactorWebAuthnResponseModel(user);
return response;
}
@ -245,7 +245,7 @@ public class TwoFactorController : Controller
[ApiExplorerSettings(IgnoreApi = true)] // Disable Swagger due to CredentialCreateOptions not converting properly
public async Task<CredentialCreateOptions> GetWebAuthnChallenge([FromBody] SecretVerificationRequestModel model)
{
var user = await CheckAsync(model, true);
var user = await CheckAsync(model, false);
var reg = await _userService.StartWebAuthnRegistrationAsync(user);
return reg;
}
@ -254,7 +254,7 @@ public class TwoFactorController : Controller
[HttpPost("webauthn")]
public async Task<TwoFactorWebAuthnResponseModel> PutWebAuthn([FromBody] TwoFactorWebAuthnRequestModel model)
{
var user = await CheckAsync(model, true);
var user = await CheckAsync(model, false);
var success = await _userService.CompleteWebAuthRegistrationAsync(
user, model.Id.Value, model.Name, model.DeviceResponse);
@ -271,7 +271,7 @@ public class TwoFactorController : Controller
public async Task<TwoFactorWebAuthnResponseModel> DeleteWebAuthn(
[FromBody] TwoFactorWebAuthnDeleteRequestModel model)
{
var user = await CheckAsync(model, true);
var user = await CheckAsync(model, false);
await _userService.DeleteWebAuthnKeyAsync(user, model.Id.Value);
var response = new TwoFactorWebAuthnResponseModel(user);
return response;