chrisogden.
KKinde
•Created by chrisogden. on 10/11/2024 in #💻┃support
Switch organization for logged in user
@Claire_Kinde Thank you! While that example isn't an exact match for sveltekit I was able to use it to accomplish the goal in my switch function I used
``goto(\
/api/auth/login?org_code=${orgCode}`)7 replies
KKinde
•Created by chrisogden. on 9/16/2024 in #💻┃support
ExpressJS Backend receiving API requests with bearer tokens
I posted some GitHub issues
6 replies
KKinde
•Created by chrisogden. on 9/16/2024 in #💻┃support
ExpressJS Backend receiving API requests with bearer tokens
Pass the JWT to the backend. I am using the sveltekit sdk. It sets cookies for just the subdomain it is on so it doesn’t automatically pass the cookie and you can’t access the cookie from sveltekit. The robustness of the sveltekit sdk is great. Would be nice if I could change the domain the cookie is set on. I tried copying the cookie in server hooks and layout.server, which does work but it 500s on logout.
From the api backend side (separate of sveltekit) I wrote custom logic to extract the auth header or cookie and it works but would be nice to see that in nodejs sdk or a sample starter kit. My workout does handle authentication but doesn’t provide a good way to look at orgs, roles or permissions since nodejs sdk is unaware of the session since it was created in sveltekit
I will go read both those docs, maybe it will clear up the audience item as well.
6 replies