Exemple #1
0
 public IActionResult Post([FromForm] string passcode, [FromForm] string phonenumber)
 {
     if (UserAuthDAL.VerifyUser(passcode, phonenumber))
     {
         string token = UserAuthDAL.CreateToken(phonenumber);
         return(Ok(new AuthenticationResponse(token)));
     }
     return(Unauthorized());
 }
        public ActionResult Post([FromForm] string phonenumber, [FromForm] string password)
        {
            if (UserAuthDAL.Login(phonenumber, password))
            {
                string token = UserAuthDAL.CreateToken(phonenumber);
                return(Ok(token));
            }

            return(Unauthorized());
        }