Handling auth on server-side?

I'm using React Router v7 (Remix), and I want to authenticate on the server. But it seems like BE doesn't support server-side auth. Is this really so?
14 Replies
nikatune
nikatune2mo ago
wdym? you can use auth.api
Mike Stop Continues
If I understand correctly, then you're opting out of all cookie/session management. I don't see any helpers on the api or docs for working with them without building a lot of authentication from scratch.
RME
RME2mo ago
auth.api works great for server sided auth, however you'll be missing built in rate limiting
Mike Stop Continues
This example is not really how to integrate with Remix, but with a react SPA: https://www.better-auth.com/docs/integrations/remix
Remix Integration | Better Auth
Integrate Better Auth with Remix.
Mike Stop Continues
Is there a good example anywhere of working on the server with BE?
nikatune
nikatune2mo ago
nikatune
nikatune2mo ago
you can check this
Mike Stop Continues
That's also using client-side methods.
nikatune
nikatune2mo ago
client-side and server-side api's almost same authClient.updateUser() auth.api.updateUser() Its always like this maybe i missunderstanding you
Mike Stop Continues
Let's say I wanted to authenticate the user as the result of a fom post, then set-cookie. What does that look like?
Solution
RME
RME2mo ago
nikatune
nikatune2mo ago
API | Better Auth
Better Auth API.
Mike Stop Continues
Ahh, that's what I'm looking for. Thank you. Is it only rate limiting I'm otherwise missing out on?
RME
RME2mo ago
i’m 90% sure yes, the rest should be handled no problem

Did you find this page helpful?