Example #1
0
        public IActionResult Token([FromBody] UserForSingIn userData)
        {
            if (_userDataProvider.CheckUserName(userData))
            {
                var tokenString = _userDataProvider.GenerateJwtToken(userData.Username);
                return(Ok(new { token = tokenString }));
            }

            return(BadRequest(new { Error = "wrong request" }));
        }