refined auth.

This commit is contained in:
ivancheahhh
2024-01-04 15:46:28 -07:00
parent bb82f1ab72
commit a72637db0f
2 changed files with 3 additions and 1 deletions

View File

@@ -111,6 +111,8 @@ namespace CarCareTracker.Controllers
existingUserConfig.UserPasswordHash = string.Empty;
}
System.IO.File.WriteAllText("userConfig.json", JsonSerializer.Serialize(existingUserConfig));
//destroy any login cookies.
Response.Cookies.Delete("ACCESS_TOKEN");
return Json(true);
}
catch (Exception ex)

View File

@@ -110,7 +110,7 @@
if (result.isConfirmed) {
$.post('/Login/CreateLoginCreds', { userName: result.value.username, password: result.value.password }, function (data) {
if (data) {
window.location.href = '/Home';
window.location.href = '/Login';
} else {
errorToast("An error occurred, please try again later.");
}