-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.config.ts
28 lines (26 loc) · 860 Bytes
/
app.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import type { FetchContext } from 'ofetch'
import type { ConsolaInstance } from 'consola'
import type { NuxtApp } from '#app'
export default defineAppConfig({
sanctum: {
interceptors: {
onRequest: async (
app: NuxtApp,
ctx: FetchContext,
logger: ConsolaInstance
) => {
console.log(ctx)
ctx.options.headers.append('accept','application/json')
logger.debug(`custom onRequest interceptor (${ctx.request})`);
},
onResponse: async (
app: NuxtApp,
ctx: FetchContext,
logger: ConsolaInstance
) => {
console.log('s')
logger.debug(`custom onResponse interceptor (${ctx.request})`);
},
},
},
});