public Session <NullT> Authenticate(Session <NullT> sessionIn)
        {
            APLPX.Entity.Session <NullT> sessionOut = _userData.Authenticate(sessionIn);
            _userData.Dispose();

            return(sessionOut);
        }
예제 #2
0
        public IActionResult Authenticate([FromBody] AuthenticateRequest model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var response = _userData.Authenticate(model);

            if (response == null)
            {
                return(BadRequest(new { message = "Username or password is incorrect" }));
            }

            return(Ok(response));
        }