Braňo
Braňo
NNuxt
Created by Braňo on 10/17/2024 in #❓・help
Missing cookies in request from server
Okay, I finally have tokens on server but now I am not getting redirected to authorization page... its just ignoring 302 replies
27 replies
NNuxt
Created by Braňo on 10/17/2024 in #❓・help
Missing cookies in request from server
but this might work let me check
27 replies
NNuxt
Created by Braňo on 10/17/2024 in #❓・help
Missing cookies in request from server
But as I am trying to explain, my cookies are lost in communication between nuxt server and external server.
27 replies
NNuxt
Created by Braňo on 10/17/2024 in #❓・help
Missing cookies in request from server
No I am trying to get data into pinia store in ssr context. But i am missing auth token in cookies that are sent from nuxt server to my external server with data
27 replies
NNuxt
Created by Braňo on 10/17/2024 in #❓・help
Missing cookies in request from server
I tried reading cookie header in middleware and its there so probably i just somehow need to proxy these cookies into requests that i am sending later
27 replies
NNuxt
Created by Braňo on 10/17/2024 in #❓・help
Missing cookies in request from server
Data fetching runs in middleware
27 replies
NNuxt
Created by Braňo on 10/17/2024 in #❓・help
Missing cookies in request from server
No description
27 replies
NNuxt
Created by Braňo on 10/17/2024 in #❓・help
Missing cookies in request from server
In server/middlewares/auth.ts i added this snippet:
export default defineEventHandler(async (event) => {
const originalHeaders = useRequestHeaders();
logger.log("Original headers", originalHeaders);
setHeader(useRequestEvent()!, "set-cookie", originalHeaders["set-cookie"]);

// ...
export default defineEventHandler(async (event) => {
const originalHeaders = useRequestHeaders();
logger.log("Original headers", originalHeaders);
setHeader(useRequestEvent()!, "set-cookie", originalHeaders["set-cookie"]);

// ...
27 replies
NNuxt
Created by Braňo on 10/17/2024 in #❓・help
Missing cookies in request from server
I am unable to use this function in server context
27 replies
NNuxt
Created by Braňo on 10/17/2024 in #❓・help
Missing cookies in request from server
No description
27 replies
NNuxt
Created by Braňo on 10/17/2024 in #❓・help
Missing cookies in request from server
Hm interesting I will try and let you know 🙂
27 replies
NNuxt
Created by Braňo on 10/17/2024 in #❓・help
Missing cookies in request from server
27 replies
NNuxt
Created by Braňo on 10/17/2024 in #❓・help
Missing cookies in request from server
When I was trying to do same on the client it was working but I want to utilize SSR
27 replies