public IActionResult Login([FromBody] LoginRequest request) { if (ModelState.IsValid) { LoginResponse response = userService.Login(request); if (response.Success) { return(Ok(response.Auth)); } return(BadRequest(response.AllErrors())); } return(BadRequest(ModelState.Errors())); }
public IActionResult GoogleLogin([FromQuery] TokenRequest request) { if (ModelState.IsValid) { LoginResponse response = userService.GoogleLogin(request.Token); if (response.Success) { return(Ok(response.Auth)); } return(BadRequest(response.AllErrors())); } return(BadRequest(ModelState.Errors())); }