0
I have an Asp.net MVC page, using entityframework, and I have a login system :
public ActionResult Index(LoginModel model)
{
if (ModelState.IsValid)
{
try
{
if (Membership.ValidateUser(model.Email, model.Senha))
{
Pessoa pessoa = this.PessoaServico.GetMany(p => p.Email == model.Email).First();
if (pessoa is Lojista)
return RedirectToAction("Index", "Dashboard", new { area = "Lojista" });
}
}
catch (Exception e)
{
ModelState.AddModelError("erro", "Ocorreu um erro inesperado");
}
}
ModelState.AddModelError("erro", "Usuário e/ou Senha Inválidos.");
return View(model);
}
I only authorize anyone who is logged in with the following description [Authorize(Roles = "Lojista")]
the login part of the system was not I who made, so I am with a little difficulty of intender the functioning, and when I look for something about I can not mean very well.
I saw that some people set some things on the web.config, but I couldn’t understand it. In case you need more information and just say.
What is your system? MVC or webforms? ado.net or entityframework? made using Identity, Membership or in-race login system?
– Dorathoto
I’ll improve the question...
– William Cézar
My lack of notion hinders the preparation of the question, I hope to intender, but as it was not I who logged in I do not know how it works, because I was told that the redirection was done on the web.config when they did not index the user, but I didn’t find anything there that related to this.
– William Cézar
now it’s much clearer, I’ll answer the question
– Dorathoto