[add] Logout
Also made general fixes to the css
This commit is contained in:
18
api-payroll/public/js/landing.js
Normal file
18
api-payroll/public/js/landing.js
Normal file
@@ -0,0 +1,18 @@
|
||||
function logout() {
|
||||
var baseUrl = getbaseUrl();
|
||||
|
||||
$.ajax({
|
||||
url: baseUrl + '/api/session/logout',
|
||||
type: 'GET',
|
||||
dataType: 'json',
|
||||
success:function(data){
|
||||
window.location.replace(baseUrl + '/html/login.php');
|
||||
},
|
||||
error:function(x) {
|
||||
if (x.status==500){
|
||||
$('#modalLoginError').modal('show');
|
||||
document.getElementById('modalLoginErrorBody').innerHTML = "The user or password didnt match, please try again";
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user