We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3754884 commit f3153c1Copy full SHA for f3153c1
1 file changed
lib/interceptors/csrf-token.ts
@@ -6,6 +6,7 @@
6
import type { CancelableAxiosInstance } from '../client.ts'
7
import type { InterceptorErrorHandler } from './index.ts'
8
9
+import { emit } from '@nextcloud/event-bus'
10
import { generateUrl } from '@nextcloud/router'
11
import { isAxiosError } from 'axios'
12
@@ -35,6 +36,7 @@ export function onCsrfTokenError(axios: CancelableAxiosInstance): InterceptorErr
35
36
const { data: { token } } = await axios.get(generateUrl('/csrftoken'))
37
console.debug(`New request token ${token} fetched`)
38
axios.defaults.headers.requesttoken = token
39
+ emit('csrf-token-update', { token })
40
41
return axios({
42
...config,
0 commit comments