コード例 #1
0
        public async Task <bool> Login(pwd lol)
        {
            var serializedUser = JsonConvert.SerializeObject(lol);

            var response = await client.PostAsync($"api/user/login", new StringContent(serializedUser, Encoding.UTF8, "application/json"));

            return(response.IsSuccessStatusCode);
        }
コード例 #2
0
        public IActionResult Login([FromBody] pwd lol)
        {
            var res = UserRepository.Login(lol.Email, lol.Password);

            if (res)
            {
                return(BadRequest("Wrong Password!"));
            }
            else
            {
                return(Ok());
            }
        }
コード例 #3
0
 public ActionResult changclick(pwd pw)
 {
     if (ModelState.IsValid)
     {
         registrationEntities ob = new registrationEntities();
         ObjectParameter      op = new ObjectParameter("status", typeof(int));
         ob.sp_changepwd(pw.oldpwd, pw.newpwd, Session["log"].ToString(), op);
         int i = Convert.ToInt32(op.Value);
         if (i == 1)
         {
             pw.result = "password changed";
             return(View("changeload", pw));
         }
         else
         {
             pw.result = "invalid password";
             return(View("changeload", pw));
         }
     }
     return(View("changload", pw));
 }