Add a hack to append the X-Cachet-Token when in the dashboard
This commit is contained in:
@@ -16,6 +16,9 @@ $(function () {
|
||||
beforeSend: function (xhr) {
|
||||
xhr.setRequestHeader('Accept', 'application/json');
|
||||
// xhr.setRequestHeader('Content-Type', 'application/json; charset=utf-8');
|
||||
if (typeof window.apiKey !== 'undefined') {
|
||||
xhr.setRequestHeader('X-Cachet-Token', window.apiKey);
|
||||
}
|
||||
},
|
||||
statusCode: {
|
||||
401: function () {
|
||||
|
||||
@@ -62,4 +62,7 @@
|
||||
</body>
|
||||
@yield('js')
|
||||
<script src="{{ mix('dist/js/all.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
window.apiKey = "{{ auth()->user()->api_key }}";
|
||||
</script>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user