[HttpPost]
[ValidateAntiForgeryToken]
[ValidateUmbracoFormRouteString]
public async Task
Login([FromForm] LoginViewModel model)
{
if (!ModelState.IsValid)
{
return RedirectToCurrentUmbracoPage();
}
bool userIsValid = await _usersMembers.IsUserValid(
model.EmailOrUsername, model.Password);
if (!userIsValid)
{
TempData["LoginSuccess"] = "Invalid email/username or password";
return RedirectToCurrentUmbracoPage();
}
return RedirectToUmbracoPage(Guid.Parse("ee7ae6f0-056c-4e1e-8c30-772fd2c53a30"));
}