Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use updated csrf token on first login #117

Merged
merged 2 commits into from
Jun 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/runtime/httpFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,19 @@ export function createHttpClient(logger: ConsolaInstance): $Fetch {
retry: options.client.retry,

async onRequest(context: FetchContext): Promise<void> {
await nuxtApp.runWithContext(() => {
for (const interceptor of requestInterceptors) {
interceptor(nuxtApp, context, logger);
}
});
for (const interceptor of requestInterceptors) {
await nuxtApp.runWithContext(async () => {
await interceptor(nuxtApp, context, logger);
});
}
},

async onResponse(context: FetchContext): Promise<void> {
await nuxtApp.runWithContext(() => {
for (const interceptor of responseInterceptors) {
interceptor(nuxtApp, context, logger);
}
});
for (const interceptor of responseInterceptors) {
await nuxtApp.runWithContext(async () => {
await interceptor(nuxtApp, context, logger);
});
}
},

async onResponseError({ request, response }): Promise<void> {
Expand Down
Loading