Example #1
0
        public string LogIn(LoginDTO model)
        {
            var result = _db.Users.Any(t => t.Username == model.Username && t.Password == model.Password);

            if (result)
            {
                var response = _mapper.Map <UserDTO>(model);
                var token    = _jwtManager.GenerateJSONWebToken(response);
                return(token);
            }
            return("Login Failed");
        }