For search, if we get a 401, redirect to the login page

This commit is contained in:
Deon George
2022-08-03 16:32:38 +10:00
parent 8e9ca4c531
commit 61f38aefe7
2 changed files with 9 additions and 4 deletions

View File

@@ -83,7 +83,7 @@
<script type="text/javascript">
$(document).ready(function() {
$("input[name=q]").typeahead({
$('input[name=q]').typeahead({
autoSelect: false,
scrollHeight: 10,
theme: 'bootstrap4',
@@ -149,6 +149,11 @@
$('span[name=searching]').addClass("d-none");
}
}
},
statusCode: {
401: function() {
window.parent.location.href = '{{ route('login') }}';
}
}
})
}, 500);