Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

Access cookies from another service

$
0
0

I'm trying to work with a clean and hexagonal architecture for my sveltekit frontend, connecting to an external API.When I want to load some data for a page, inside my load function I instantiate a simple command/DTO that I pass to a usecase class, which passes it on to a handler class, which then calls the external API to get the data via a gateway class.Now architecture wise, the load function is inside the Infrastructure layer, then command/usecase/handler are all inside the Application layer, then the gateway is in the Infrastructure layer but I instantiate it inside my handler via dependency injection on a Domain interface so I'm good on that.

Problem is, I need access to the cookies in my gateway, so I can attach them to my outgoing request and authenticate on my external API. But those cookies are only accessible inside my load function as far as I know, and I don't want to drill either the whole original request or the cookies through my whole usecase because the Application layer shouldn't care about that.

I would like to get access to existing cookies for the current original request inside my gateway directly, is there any way I could do that in SvelteKit while still being careful about not sharing data between users on the node server?


Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>