Skip to content

Commit

Permalink
fix: withCredential:true
Browse files Browse the repository at this point in the history
  • Loading branch information
halionaz committed Aug 22, 2024
1 parent f27c4f0 commit df0bb3a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion libs/client/AuthProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function AuthProvider() {
const { data } = await axios.post(
`${process.env.NEXT_PUBLIC_API_URL}/auth/refresh`,
{},
{ headers: { Authorization: `Bearer ${refreshToken}` } },
{ headers: { Authorization: `Bearer ${refreshToken}` }, withCredentials: true },
);
if (data.accessToken && data.refreshToken) {
setTokens(data.accessToken, data.refreshToken);
Expand Down
1 change: 1 addition & 0 deletions libs/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import axios from 'axios';
const client = axios.create({
baseURL: process.env.NEXT_PUBLIC_API_URL ?? '',
headers: { 'Content-Type': 'application/json' },
withCredentials: true,
});

export default client;

0 comments on commit df0bb3a

Please sign in to comment.