Ejemplo n.º 1
0
        public IActionResult Token(string email, string password)
        {
            var account = _accountRepository.GetAccount(email, password);

            if (account == null)
            {
                return(BadRequest(new { errorText = "Invalid email or password." }));
            }

            var response = new
            {
                access_token = _tokenGenerator.GenerateEncodedJwt(account),
            };

            return(Json(response));
        }