kainashiCZ
kainashiCZ
NNuxt
Created by kainashiCZ on 9/9/2024 in #❓・help
Cannot set cookie if server route contains $fetch
Hello, I am not sure what is exactly the trouble, but I am trying to implement Discord login. I have server route /verify-discord-login, where I get user's tokens and I would like to set a cookie to identify user as logged in. However, setCookie seems to only work when there is no $fetch to Discord's server. Even though I receive user's profile data, the cookie just does not appear in the Application tab in DevTools. If I just set any cookie value and comment out all await $fetch, the cookie is set correctly. I have SSR mode on. If I turn it off, it works, but this inconsistency bugs me. Any ideas what else can I do?
1 replies