hooks.server.ts can no longer read cookies once auth/login api published to Azure vs localhost #9043
Unanswered
josephceth
asked this question in
Q&A
Replies: 1 comment
-
I'm running into this issue also. I have the frontend code on Vercel talking to a backend REST API on Heroku. On a fresh page load (refreshing the page in the browser or typing the URL and pressing [Enter]), in the first time that |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We have a web api backend where */api/auth/login returns secure HTTPOnly accessToken and refreshToken cookies. These cookies are read in hooks.server.ts via:
C# CookieOptions
Once the API was published to Azure, the site is still running on localhost, the accessToken and refreshTokens are not long getting set, event.cookies.get('accessToken') is undefined
I have confirmed via the site's swagger frontend, Postman, and Chrome Dev Tools that the cookies are being returned in the response.
I'm sure I have this setup incorrectly, but is there a reason it works when the API is running locally vs in Azure? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions