| 1234567891011121314151617181920 |
- export default function ({ $http, redirect, store }) {
- $http.onRequest(config => {
- config.headers.set('Authorization', `Bearer ${store.state.profile.access.bearer}`)
- config.headers.set('x-accessid', `${store.state.profile.access.accessId}`)
- })
- $http.onResponse(async (request, options, response) => {
- })
- $http.onError((error) => {
- // In case of unauthorized, redirect to a specific page
- if (error.statusCode === 401) {
- redirect('/login')
- }
- if (error.statusCode === 403) {
- console.debug('forbidden');
- }
- })
- }
|