Redirect to Login page
This commit is contained in:
parent
9e9e481576
commit
42e1ac95c8
@ -15,7 +15,7 @@ $(document).ready(function() {
|
||||
btn.prop("disabled", true);
|
||||
btn.html("Logging in… <i class=\"fa fa-spin fa-circle-notch\"></i>");
|
||||
jsCore.apiCall("/user/login", {"username": username, "password": password, "stayLoggedIn": stayLoggedIn }, function(data) {
|
||||
document.location = "/admin/dashboard";
|
||||
document.location.reload();
|
||||
}, function(err) {
|
||||
btn.html("Login");
|
||||
btn.prop("disabled", false);
|
||||
|
2
js/admin.min.js
vendored
2
js/admin.min.js
vendored
File diff suppressed because one or more lines are too long
@ -19,7 +19,12 @@ export default class API {
|
||||
body: JSON.stringify(params)
|
||||
});
|
||||
|
||||
return await response.json();
|
||||
let res = await response.json();
|
||||
if (!res.success && res.msg === "You are not logged in.") {
|
||||
document.location.reload();
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
async fetchUser() {
|
||||
|
Loading…
Reference in New Issue
Block a user