mirror of
https://github.com/bitwarden/server.git
synced 2025-07-04 01:22:50 -05:00
Fix/identity service model validation (#1837)
* Fix indentation * Fix comment * Extract ModelStateValidationFilter add to Indentity MVC opts * Remove unnecessary base constructor call
This commit is contained in:
@ -30,7 +30,7 @@ namespace Bit.Identity.Controllers
|
||||
_userService = userService;
|
||||
}
|
||||
|
||||
// Moved from API, If you modify this endpoint, please update Identity as well.
|
||||
// Moved from API, If you modify this endpoint, please update API as well.
|
||||
[HttpPost("register")]
|
||||
[CaptchaProtected]
|
||||
public async Task PostRegister([FromBody] RegisterRequestModel model)
|
||||
@ -51,7 +51,7 @@ namespace Bit.Identity.Controllers
|
||||
throw new BadRequestException(ModelState);
|
||||
}
|
||||
|
||||
// Moved from API, If you modify this endpoint, please update Identity as well.
|
||||
// Moved from API, If you modify this endpoint, please update API as well.
|
||||
[HttpPost("prelogin")]
|
||||
public async Task<PreloginResponseModel> PostPrelogin([FromBody] PreloginRequestModel model)
|
||||
{
|
||||
|
@ -58,7 +58,11 @@ namespace Bit.Identity
|
||||
services.AddMemoryCache();
|
||||
|
||||
// Mvc
|
||||
services.AddMvc();
|
||||
// MVC
|
||||
services.AddMvc(config =>
|
||||
{
|
||||
config.Filters.Add(new ModelStateValidationFilterAttribute());
|
||||
});
|
||||
|
||||
if (!globalSettings.SelfHosted)
|
||||
{
|
||||
|
Reference in New Issue
Block a user