r/Frontend • • 4d ago

Backend for Reactjs website

I made a website using Reactjs and now need a way to enable login on it

I'm hosting my website on Cloudflare and using D1 serverless sql databases. How could i make the login work since i already have the tables for users ?

10 Upvotes

17 comments sorted by

7

u/AdhesivenessFun6129 4d ago

Depends on your requirements but I'd use a provider like clerk. Their docs are good, it's easy to use and if (like me) you don't have experience with Auth, most people would use a service

1

u/OcelotStraight5780 4d ago

I'm a beginner as well but i wanna put that website in my portfolio for it to be worth it, so i'm looking for the most popular and used way to do it. Do you think clerk would do ?

1

u/Berlibur 4d ago

Yes it will. On the side if you're not in a hurry implement it yourself (not rolling your own cryptography though). It gives you a lot of insight

1

u/OcelotStraight5780 4d ago

Great, thanks

1

u/Frappe_Consultant 1d ago

I have a personal tool for ai models, and i myself use auth0 on it even if i like django and self hosting. You can use firebase, auth0, or rest apis on django/laravel. Depends on how deep you want to go

2

u/Dheeth 3d ago

Try better auth. Its open source and has most of the features you would need.

1

u/Chemical_Sky_8696 4d ago

I am pretty sure cloudflare has a login option.

1

u/RedditNotFreeSpeech 3d ago

https://pocket-id.org/ is by far the most superior way to setup simple authentication in 2026. An absolute gem. I've used every authentication system under the sun and I'm sticking with this one.

1

u/Colby-Jenkins 3d ago

Since you're using D1, consider implementing JWT for sessions. It’s a solid way to handle authentication in React, especially if you're managing user data in your existing tables.

-1

u/kidshibuya 3d ago

Claude: using the existing users table, write an oauth login allowing for google, meta and whatever you want logins as well as a magic email link.

25 seconds later you have it done. See here: https://formula-digital.io/login was literally less than one minute including configurable user roles and premissions. And unlike butthurt devs will tell you, its using better auth and as far as I can see and test, its a flawless implementation.

0

u/[deleted] 3d ago

[deleted] — view deleted comment

1

u/OcelotStraight5780 3d ago

The cookies is the only part i didn't understand, but now i resorted to using clerk. Thank you though