Merge branch 'main' into Hargata/increase.upload.size
# Conflicts: # Views/Login/Index.cshtml
This commit is contained in:
@@ -26,9 +26,9 @@ namespace CarCareTracker.Controllers
|
|||||||
_logger = logger;
|
_logger = logger;
|
||||||
_loginLogic = loginLogic;
|
_loginLogic = loginLogic;
|
||||||
}
|
}
|
||||||
public IActionResult Index()
|
public IActionResult Index(string redirectURL = "")
|
||||||
{
|
{
|
||||||
return View();
|
return View(model: redirectURL);
|
||||||
}
|
}
|
||||||
public IActionResult Registration()
|
public IActionResult Registration()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -157,7 +157,13 @@ namespace CarCareTracker.Middleware
|
|||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Response.Redirect("/Login/Index");
|
if (Request.Path.Value == "/Vehicle/Index" && Request.QueryString.HasValue)
|
||||||
|
{
|
||||||
|
Response.Redirect($"/Login/Index?redirectURL={Request.Path.Value}{Request.QueryString.Value}");
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
Response.Redirect("/Login/Index");
|
||||||
|
}
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
protected override Task HandleForbiddenAsync(AuthenticationProperties properties)
|
protected override Task HandleForbiddenAsync(AuthenticationProperties properties)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
@using CarCareTracker.Helper
|
@using CarCareTracker.Helper
|
||||||
@inject IConfigHelper config
|
@inject IConfigHelper config
|
||||||
@inject ITranslationHelper translator
|
@inject ITranslationHelper translator
|
||||||
|
@model string
|
||||||
@{
|
@{
|
||||||
var logoUrl = config.GetLogoUrl();
|
var logoUrl = config.GetLogoUrl();
|
||||||
var userLanguage = config.GetServerLanguage();
|
var userLanguage = config.GetServerLanguage();
|
||||||
@@ -38,4 +39,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<script>
|
||||||
|
function getRedirectURL(){
|
||||||
|
return { url: decodeHTMLEntities('@Model') };
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -1 +1,8 @@
|
|||||||
<h1>Access Denied</h1>
|
<div class="row">
|
||||||
|
<div class="col-1">
|
||||||
|
<a href="/Home" class="btn btn-secondary btn-md mt-1 mb-1"><i class="bi bi-arrow-left-square"></i></a>
|
||||||
|
</div>
|
||||||
|
<div class="col-11">
|
||||||
|
<h1>Access Denied</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -4,7 +4,13 @@
|
|||||||
var isPersistent = $("#inputPersistent").is(":checked");
|
var isPersistent = $("#inputPersistent").is(":checked");
|
||||||
$.post('/Login/Login', {userName: userName, password: userPassword, isPersistent: isPersistent}, function (data) {
|
$.post('/Login/Login', {userName: userName, password: userPassword, isPersistent: isPersistent}, function (data) {
|
||||||
if (data) {
|
if (data) {
|
||||||
window.location.href = '/Home';
|
//check for redirectURL
|
||||||
|
var redirectURL = getRedirectURL().url;
|
||||||
|
if (redirectURL.trim() != "") {
|
||||||
|
window.location.href = redirectURL;
|
||||||
|
} else {
|
||||||
|
window.location.href = '/Home';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
errorToast("Invalid Login Credentials, please try again.");
|
errorToast("Invalid Login Credentials, please try again.");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user