refined auth.
This commit is contained in:
@@ -111,6 +111,8 @@ namespace CarCareTracker.Controllers
|
|||||||
existingUserConfig.UserPasswordHash = string.Empty;
|
existingUserConfig.UserPasswordHash = string.Empty;
|
||||||
}
|
}
|
||||||
System.IO.File.WriteAllText("userConfig.json", JsonSerializer.Serialize(existingUserConfig));
|
System.IO.File.WriteAllText("userConfig.json", JsonSerializer.Serialize(existingUserConfig));
|
||||||
|
//destroy any login cookies.
|
||||||
|
Response.Cookies.Delete("ACCESS_TOKEN");
|
||||||
return Json(true);
|
return Json(true);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|||||||
@@ -110,7 +110,7 @@
|
|||||||
if (result.isConfirmed) {
|
if (result.isConfirmed) {
|
||||||
$.post('/Login/CreateLoginCreds', { userName: result.value.username, password: result.value.password }, function (data) {
|
$.post('/Login/CreateLoginCreds', { userName: result.value.username, password: result.value.password }, function (data) {
|
||||||
if (data) {
|
if (data) {
|
||||||
window.location.href = '/Home';
|
window.location.href = '/Login';
|
||||||
} else {
|
} else {
|
||||||
errorToast("An error occurred, please try again later.");
|
errorToast("An error occurred, please try again later.");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user