Replies: 1 comment 5 replies
-
You can't. Cookies are included in the request to Remix. You'll need to pass the token to Axios when making the Axios request. export const loader: LoaderFunction = async ({ request }) => {
let session = await getSession(request);
const user = session.get(authenticator.sessionKey)
// pass request config with user token in header
axios.get('/some/api', { headers: { 'Authorization', `Bearer ${user.token}` } })
return json(user)
} |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I can get userToken in loader or action function
but how can I get cookies in axios outside of loader or action function?
like:
Beta Was this translation helpful? Give feedback.
All reactions