Next.js Discord

Discord Forum

Google auth, next.js, next-auth, can not set cookie in signIn callback

Unanswered
American Wirehair posted this in #help-forum
Open in Discord
American WirehairOP
0

In my signIn callback function, I'm making an API POST request to the backend for user login and registration. Once the backend processes the login and registration, it sends a response containing a token, this token will be used later as accessToken for fetching the backend data (Laravel), in my code set this token as let myToken = response.data.token. Then, I'm trying to set it in cookies, but unfortunately, it's not working as expected. Can someone assist me with this issue?

0 Replies