ChestnutWaffle
BABetter Auth
•Created by ChestnutWaffle on 5/15/2025 in #help
Elysia backend + Nextjs frontend, getSession issue
like how it is with firebase admin, they advise against using that anywhere other that server side
16 replies
BABetter Auth
•Created by ChestnutWaffle on 5/15/2025 in #help
Elysia backend + Nextjs frontend, getSession issue
i personally don't think there's any problem with using client code on the server, just the other way around
16 replies
BABetter Auth
•Created by ChestnutWaffle on 5/15/2025 in #help
Elysia backend + Nextjs frontend, getSession issue
it's just that since my urls are localhost the nextjs app was checking within the container where nextjs was, but my backend is on another container
16 replies
BABetter Auth
•Created by ChestnutWaffle on 5/15/2025 in #help
Elysia backend + Nextjs frontend, getSession issue
i don't think that's the case, it's the other way around, nextjs warns us when we use a non NEXT_PUBLIC prefix on the client side
16 replies
BABetter Auth
•Created by ChestnutWaffle on 5/15/2025 in #help
Elysia backend + Nextjs frontend, getSession issue
atleast I understand now why it didn't work
16 replies
BABetter Auth
•Created by ChestnutWaffle on 5/15/2025 in #help
Elysia backend + Nextjs frontend, getSession issue
probably didn't work because the whole backend+frontend is in a docker compose stack. and trying to fetch from port 3000 of localhost from inside a docker container wouldn't work because backend is in another container
16 replies
BABetter Auth
•Created by ChestnutWaffle on 5/15/2025 in #help
Elysia backend + Nextjs frontend, getSession issue
@sebastian i've figured out why my api calls were not working from the server side of nextjs.
it's because i was using a NEXT_PUBLIC prefix env variable. I don't know why it would be a problem to use a client env in server side instead of vice versa, but
doing this and using
authServer
at server side call works as expected16 replies
BABetter Auth
•Created by ChestnutWaffle on 5/15/2025 in #help
Elysia backend + Nextjs frontend, getSession issue
so the authClient doesn't work on the server side? even while passing the right headers?
16 replies