Jonghakseo / chrome-extension-boilerplate-react-vite

Chrome Extension Boilerplate with React + Vite + Typescript
MIT License
2.26k stars 329 forks source link

How to do user authentication #685

Closed codergigachad closed 3 weeks ago

codergigachad commented 4 weeks ago

Is your feature request related to a problem? Please describe. What is the way to do authentication inside of chrome extension. From where(popup, content-ui, injected, background, options page) to launch the signup flow, how much part should be in a backend, which auth library to use, which database to use, where to store cookies, how to do url redirects etc.

Describe the solution you'd like I would think of the solution for a boilerplate to involve libraries like lucia auth or auth.js and then storing the sessions inside of a database like Cloudflare D1

Describe alternatives you've considered There can be many alternatives for any available tech stack.

Additional context I wan't to implement auth in this way:- https://youtu.be/ZD2Lt5GFo48

wonkyDD commented 3 weeks ago

I have wondered auth-related things about this project either!

btw, do you have any other reasons for preferring session-based authentication over jwt way?

PatrykKuniczak commented 3 weeks ago

There i have google auth here: https://github.com/PatrykKuniczak/YT_Notifier/blob/main/react-app/src/pages/popup/pages/auth/auth.page.tsx

The auth is on backend, but if you don't want to use OAuth, you can use e.g https://github.com/MomenSherif/react-oauth

But i didn't work with other methods.

After all, i don't think it's boilerplate related.

@Jonghakseo Add on the legacy version, tutorials for UI libs.

But it's not our responsibility to manage cases like that in our project.

We don't care about what you want to implement in addition, maybe somebody will create some kind of tutorial for several auth methods in the future, but we don't plan it for now.