Next.js Discord

Discord Forum

General Question about Next.js

Unanswered
Dutch posted this in #help-forum
Open in Discord
DutchOP
I have not used ssr before so i just want to ask some clarify-ing questions.
I am using firebase auth to authenticate users for an admin dashboard to add remove products etc.
The part that is unclear to me is when can i use ssr since the auth is done client side and if i want to acess something i have to use a hook.
What can it be useful for when building a dashboard , maybe you would suggest that i save the token in cookies and make requests with it server sided but is that the prefered way, arent we to offload the server load by fetching client side ?

2 Replies

American Crow
You basically want a Auth Provider which supports SSR.
I don't know about Firebase but Supabase wrote a good Blogpost about it when they started supporting Next14 (RSC).
I know that supabase is not firebase however the blogpost got some good info in it, to clarify the concept of SSR Auth vs Client Auth:

https://supabase.com/blog/supabase-is-now-compatible-with-nextjs-14
DutchOP
Hmm i do understand that but in my case that the auth is client sided , what can be SSR ? Or nothing 😛