예제 #1
0
        public IActionResult CreateToken([FromBody] UserLogin login)
        {
            IActionResult response = Unauthorized();
            var           user     = UserAuthentication.Authenticate(login);

            if (user != null)
            {
                var tokenString = UserAuthentication.BuildToken(user);
                response = Ok(new { token = tokenString });
            }

            return(response);
        }