logging in using websecurity only works on localhost
[Authorize]
public class SystemController : Controller
{
public ActionResult Index()
{
return View();
}
}
// this method is inside AccountController
[HttpPost]
public ActionResult Login(User acc)
{
if(ModelState.IsValid)
{
if(WebSecurity.Login(acc.username, acc.password))
return RedirectToAction("Index", "System");
}
ModelState.AddModelError("IncorrectDetails", "Wrong details. Please
try again.");
return View(acc);
}
}
When this code is run locally on my PC it works perfectly. I can log in
and log out without problems, and I can't access the SystemController when
I'm logged out. Exactly what I want.
But when I publish the site on my domain, I can't log in for some reason.
It asks me for credentials inside a window:
I don't understand why this pop-up comes first of all, and second of all I
just want the user to log-in with the regular <input type="text"> fields.
The public version has the exact same tables and data inside the database.
Nothing seems wrong with that.
No comments:
Post a Comment