import { Interceptor } from 'aurelia-fetch-client' ; export const bearerTokenInterceptor = { request ( request ) { const token = localStorage . getItem ( 'access_token' ) ; if ( ! request . headers . has ( 'Authorization' ) && token ) { request . headers . append ( 'Authorization' , `Bearer ${ token }` ) ; } return request ; } } ;