After a successful sign-in,
Inspect the browser tab, the access token isn't there
As you can see in the image above only the refresh token was set as cookie
After successfully signing in, the accessToken is not being stored as a cookie. I think this problem may be due to the access token being stored in memory. As a result:
I am unable to make requests to the backend server without using a composable.
Refreshing the protected page results in a redirect to the login page.
Additional context
I need to store the access token as a cookie, so that my axios request interceptors can append it as a bearer token when making a request to my backend server.
Update
This bug occurs when I configure the baseUrl to a different domain/ port from my frontend
currently my website is locally hosted as such
After hours of debugging, I realized that you must specify the token's sameSiteAttribute property as either lax or strict if your baseUrl differs from your frontend domain name.
Environment
Operating System: Linux
Reproduction
After a successful sign-in, Inspect the browser tab, the
access token
isn't there As you can see in the image above only the refresh token was set as cookieBelow is my nuxtconfig
Describe the bug
After successfully signing in, the
accessToken
is not being stored as a cookie. I think this problem may be due to the access token being stored in memory. As a result:Additional context
I need to store the access token as a cookie, so that my axios request interceptors can append it as a bearer token when making a request to my backend server.
Update
This bug occurs when I configure the baseUrl to a different domain/ port from my frontend currently my website is locally hosted as such
http://localhost:3000
http://localhost:3001
Logs
No response