예제 #1
0
        public async Task <IActionResult> Login(LoginFields info)
        {
            if (User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("Browse", "Thesis"));
            }
            if (ModelState.IsValid)
            {
                var result = await _userService.LoginUser(info.Email, info.Password);

                if (!result.Succeeded)
                {
                    ModelState.AddModelError("Greška", "Pogrešna email adresa ili šifra");
                    return(View(info));
                }
                return(RedirectToAction("Browse", "Thesis"));
            }
            return(View(info));
        }
예제 #2
0
 public HttpResponseMessage Post([FromBody] LoginFields value)
 {
     return(null);
 }