1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-03 00:52:49 -05:00

Update API endpoint to use RegisterResponseModel (#2282)

This commit is contained in:
Addison Beck
2022-09-19 09:35:57 -04:00
committed by GitHub
parent 26fc67eec6
commit d0c793c951
6 changed files with 26 additions and 17 deletions

View File

@ -6,7 +6,6 @@ using Bit.Core.Models.Data;
using Bit.Core.Repositories;
using Bit.Core.Services;
using Bit.Core.Utilities;
using Bit.Identity.Models;
using Bit.SharedWeb.Utilities;
using Microsoft.AspNetCore.Mvc;
@ -33,7 +32,7 @@ public class AccountsController : Controller
_captchaValidationService = captchaValidationService;
}
// Moved from API, If you modify this endpoint, please update API as well.
// Moved from API, If you modify this endpoint, please update API as well. Self hosted installs still use the API endpoints.
[HttpPost("register")]
[CaptchaProtected]
public async Task<RegisterResponseModel> PostRegister([FromBody] RegisterRequestModel model)
@ -56,7 +55,7 @@ public class AccountsController : Controller
throw new BadRequestException(ModelState);
}
// Moved from API, If you modify this endpoint, please update API as well.
// Moved from API, If you modify this endpoint, please update API as well. Self hosted installs still use the API endpoints.
[HttpPost("prelogin")]
public async Task<PreloginResponseModel> PostPrelogin([FromBody] PreloginRequestModel model)
{

View File

@ -1,4 +0,0 @@
public interface ICaptchaProtectedResponseModel
{
public string CaptchaBypassToken { get; set; }
}

View File

@ -1,14 +0,0 @@
using Bit.Core.Models.Api;
namespace Bit.Identity.Models;
public class RegisterResponseModel : ResponseModel, ICaptchaProtectedResponseModel
{
public RegisterResponseModel(string captchaBypassToken)
: base("register")
{
CaptchaBypassToken = captchaBypassToken;
}
public string CaptchaBypassToken { get; set; }
}