예제 #1
0
        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()));
        }
예제 #2
0
        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()));
        }