Ejemplo n.º 1
0
        public IActionResult Authenticate([FromBody] User userParam)
        {
            var kod = _userRep.Authenticate(userParam.UserEmail, userParam.UserPassword);

            if (!kod)
            {
                return(BadRequest(new { message = "E-posta adresi veya şifre yanlış!" }));
            }
            else
            {
                var token = GenerateToken(userParam.UserEmail);
                return(Ok(token));
            }
        }