#fun with jwt

1 messages · Page 1 of 1 (latest)

marble ridge
#

using astro js. i have axios establishing a jwt session with a refreshToken httpOnly cookie. this is happening in a react island. Works just fine until it tries to refresh and it fails on refreshToken. I don't think the cookie is being saved

hollow walrusBOT
#

Hi @marble ridge. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Based on the knowledge sources provided, it seems that there have been issues reported with setting cookies in Astro. In one case, a user reported that the Astro.cookies.set() method was not saving its value (source (https://github.com/withastro/astro/issues/5938)).

In another case, a user reported that Astro.request.headers.get('cookie') was always null, even though the cookie was being set and could be seen in the browser (source (https://github.com/withastro/astro/issues/3018)).

One solution suggested was to ensure that you have the node adapter and have the output target set to server. Also, it was mentioned that Astro.cookies only works in Astro pages (i.e., Astro files inside the /pages directory) (source (https://github.com/withastro/astro/issues/5938)).

Another solution suggested was to manually set the path to / when setting the cookie to make it available across the website (source (https://github.com/withastro/astro/issues/9969)).

If you're still having issues, it might be worth checking these solutions and ensuring that your implementation aligns with them. If the problem persists, consider opening an issue in the Astro GitHub repository for further assistance.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: