Skip to content
Discussion options

You must be logged in to vote

I found the solution.

The endpoints configured in nuxt.config.ts, by default, have credentials: 'omit'. This causes the fetch api to not send nor accept any cookies.

This can be fixed by adding a credentials key to the configuration:

endpoints: {
    login: {
        url: '/api/login',
        method: 'post',
        credentials: 'same-origin',
    },
    user: {
        url: '/api/user/',
        method: 'get',
        credentials: 'same-origin',
    },
},

See here for more information on this setting.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by chriscdn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant