public async Task <IActionResult> Login(Login command) { try { await DispatcheAsync <Login>(command); await HttpContext.SignInAsync(_logger.GetAuthName(), await _logger.GetClaimsPrincipalAsync(command.Email)); ViewBag.errorOccured = false; return(RedirectToAction("Index", "Home")); } catch (Exception ex) { ViewBag.errorOccured = true; ViewBag.errorText = ex.Message; return(View()); } }