Skip to content

Commit

Permalink
fix(auth): solve failed refresh on Cloudflare workers
Browse files Browse the repository at this point in the history
  • Loading branch information
becem-gharbi committed Feb 5, 2024
1 parent b02b51a commit 613f831
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/runtime/composables/useDirectusSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ export function useDirectusSession () {
.raw<AuthenticationData>('/auth/refresh', {
baseURL: config.rest.baseUrl,
method: 'POST',
credentials: 'include',
// Cloudflare Workers does not support "credentials" field
...(process.client ? { credentials: 'include' } : {}),
body: { mode: 'cookie' },
headers: process.server ? useRequestHeaders(['cookie']) : {}
})
Expand Down

0 comments on commit 613f831

Please sign in to comment.