Skip to content

Commit

Permalink
fix: fix apollo headers
Browse files Browse the repository at this point in the history
  • Loading branch information
Pascal Klesse committed Jun 13, 2024
1 parent eb35d0a commit 99f2fce
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/runtime/plugins/apollo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ export default defineNuxtPlugin({
const authLink = setContext((_, { headers }) => {
const { accessTokenState, refreshTokenState } = useAuthState();
let token: string;
// let cookies: string = headers?.cookies ?? defaultHeaders?.cookies ?? '';

console.log(defaultHeaders, headers);

if (accessTokenState.value && refreshTokenState.value) {
if (_.operationName === 'refreshToken') {
Expand All @@ -88,18 +85,12 @@ export default defineNuxtPlugin({
}
}

// if (process.client) {
// console.log('process.client', cookies);
// cookies = document.cookie;
// }

// console.log('cookies', cookies);

return {
headers: {
...headers,
...defaultHeaders,
Authorization: token ? `Bearer ${token}` : '', // Token in header
origin: headers.origin ?? defaultHeaders?.origin ?? defaultHeaders?.referer,
},
};
});
Expand Down

0 comments on commit 99f2fce

Please sign in to comment.