Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AuthJS support (NextAuth before) besides clerk/supabase. #16

Closed
agustif opened this issue Jul 7, 2023 · 12 comments
Closed

Add AuthJS support (NextAuth before) besides clerk/supabase. #16

agustif opened this issue Jul 7, 2023 · 12 comments

Comments

@agustif
Copy link

agustif commented Jul 7, 2023

Although I'm happy to use supabase Auth for now, I think it sucks when having to start from templates to have to create SaaS accounts. free tiers can be nice at the start but are at the trap in the long road. (And yes, supabase is still FOSS and you can self-host your own instances if you need to)

Just saw another trpc example twitter clone project using prisma/supabase/next-auth, wondering if we would like this here.

Also would be nice if some of the options for each feature like auth, or else, are modular enough that you can choice from, no idea if there's any other way to do so without mantaining separte branches for them without the burdine that keeping them on sync with master would suppose feature-wise

https://authjs.dev/

The same feature choice could be nice for database/orm as not everyone would be OK using d1/sqlite based stuff for production yet. I for one plan to use prisma/postgres on my own codebase if possible!

@timothymiller
Copy link
Owner

NextAuth.js is web only, unfortunately.

@timothymiller
Copy link
Owner

I'm hoping D1 reaches a stable release soon. It's really the best option from a cost and latency point of view.

Prisma is not supported in Cloudflare Workers because it's a chunky boi in terms of bundle size.

@agustif
Copy link
Author

agustif commented Jul 7, 2023

NextAuth.js is web only, unfortunately.

Ooops, right, quite the oversight for my part, I assumed it would be by now let's hope some day they get there. Supabase auth works nicely for me and I always can self-host it.

I'm hoping D1 reaches a stable release soon. It's really the best option from a cost and latency point of view.

I will have to try it.

Prisma is not supported in Cloudflare Workers because it's a chunky boi in terms of bundle size.

I might check out using drizzle with pg for my needs, but I'm working alongside another project which already uses pg for now and not sqlite (medusajs, fwiw) and I think It would be best to keep things as simple as possible.

Looking into integrating the supabase auth into a medusa plugin for it to handle the auth of my frontend app built with t4

It's totally fine tho, the modular aspect of the codebase makes it easy to replace any package for whatever you want with your own dependencies, it's a marvel actually how modularly it all fits like lego's or puzzle pieces into ∑hatever you're building

For now I'll try to just re-use as much from medusa for the backend and see if I need more when I reach that.

@rickylabs
Copy link

rickylabs commented Jul 7, 2023

NextAuth.js is web only, unfortunately.

Ooops, right, quite the oversight for my part, I assumed it would be by now let's hope some day they get there. Supabase auth works nicely for me and I always can self-host it.

I'm hoping D1 reaches a stable release soon. It's really the best option from a cost and latency point of view.

I will have to try it.

Prisma is not supported in Cloudflare Workers because it's a chunky boi in terms of bundle size.

I might check out using drizzle with pg for my needs, but I'm working alongside another project which already uses pg for now and not sqlite (medusajs, fwiw) and I think It would be best to keep things as simple as possible.

Looking into integrating the supabase auth into a medusa plugin for it to handle the auth of my frontend app built with t4

It's totally fine tho, the modular aspect of the codebase makes it easy to replace any package for whatever you want with your own dependencies, it's a marvel actually how modularly it all fits like lego's or puzzle pieces into ∑hatever you're building

For now I'll try to just re-use as much from medusa for the backend and see if I need more when I reach that.

We are trying to achieve exactly the same thing with medusa and supabase

We opened a discussion about that back in february (adrien2p/medusa-plugins#57).

@adrien2p first opened an issue for medusa-plugin-auth (adrien2p/medusa-plugins#58) before closing it a few days ago.

I assume we'll need to implement it ourselves. I'll let you know if I have some time to take care of that, otherwise feel free to share your work I would be happy to help you on that !

@adrien2p
Copy link

adrien2p commented Jul 7, 2023

@rickylabs indeed i wanted to implement it but i only have one request for it and not too much bandwidth, i ve asked multiple time for people if they would be willing to open a pr since i ve done the heavy lifting in the plugin, but nobody has done it so far 😅

@agustif
Copy link
Author

agustif commented Jul 7, 2023

Thank you @rickylabs I wasn't aware of this, happy to chat and share notes we'll be looking to implement this.

@rickylabs indeed i wanted to implement it but i only have one request for it and not too much bandwidth, i ve asked multiple time for people if they would be willing to open a pr since i ve done the heavy lifting in the plugin, but nobody has done it so far 😅

Hi Adrien I had not seen that, I'd be happy to open a PR myself and get any guidance from you we might need to get it merged.

It didn't occur to me that it might be already working on it

@rickylabs
Copy link

@rickylabs indeed i wanted to implement it but i only have one request for it and not too much bandwidth, i ve asked multiple time for people if they would be willing to open a pr since i ve done the heavy lifting in the plugin, but nobody has done it so far 😅

I totally understand, that's why I'm trying to put everyone in the same loop so we can manage together to implement it someday because I'm sure there are a lot of people that could benefit from it.

@agustif I'll keep you posted directly into @adrien2p issue.

@adrien2p any guidance on how we could start that implementation with your plugin ?

@agustif
Copy link
Author

agustif commented Jul 8, 2023

@rickylabs indeed i wanted to implement it but i only have one request for it and not too much bandwidth, i ve asked multiple time for people if they would be willing to open a pr since i ve done the heavy lifting in the plugin, but nobody has done it so far 😅

I totally understand, that's why I'm trying to put everyone in the same loop so we can manage together to implement it someday because I'm sure there are a lot of people that could benefit from it.

@agustif I'll keep you posted directly into @adrien2p issue.

@adrien2p any guidance on how we could start that implementation with your plugin ?

Thanks Ricky, appreciate you putting me in the radar of it, I will be trying to do this in an open repo, The plan is to copy the implementation for auth0 and go from there, adding one of the available passport-jwt npm packages for it.

I already spoke with Adrien and he advised me so, so we could probably collaborate on this if you're up for it. I'll try to push a starting PR today to my own for of medusa-plugins and we can see from there

PS: Added my email on my GH bio in case you want to reach.

Very much WIP haven't finished or tested it yet: https://github.com/agustif/medusa-plugins/tree/feat-supabase-auth

@timothymiller
Copy link
Owner

NextAuth.js is web only, unfortunately.

Ooops, right, quite the oversight for my part, I assumed it would be by now let's hope some day they get there. Supabase auth works nicely for me and I always can self-host it.

I'm hoping D1 reaches a stable release soon. It's really the best option from a cost and latency point of view.

I will have to try it.

Prisma is not supported in Cloudflare Workers because it's a chunky boi in terms of bundle size.

I might check out using drizzle with pg for my needs, but I'm working alongside another project which already uses pg for now and not sqlite (medusajs, fwiw) and I think It would be best to keep things as simple as possible.

Looking into integrating the supabase auth into a medusa plugin for it to handle the auth of my frontend app built with t4

It's totally fine tho, the modular aspect of the codebase makes it easy to replace any package for whatever you want with your own dependencies, it's a marvel actually how modularly it all fits like lego's or puzzle pieces into ∑hatever you're building

For now I'll try to just re-use as much from medusa for the backend and see if I need more when I reach that.

Are you making an ecommerce app with medusa backend and t4-app frontend?

@agustif
Copy link
Author

agustif commented Jul 13, 2023

NextAuth.js is web only, unfortunately.

Ooops, right, quite the oversight for my part, I assumed it would be by now let's hope some day they get there. Supabase auth works nicely for me and I always can self-host it.

I'm hoping D1 reaches a stable release soon. It's really the best option from a cost and latency point of view.

I will have to try it.

Prisma is not supported in Cloudflare Workers because it's a chunky boi in terms of bundle size.

I might check out using drizzle with pg for my needs, but I'm working alongside another project which already uses pg for now and not sqlite (medusajs, fwiw) and I think It would be best to keep things as simple as possible.
Looking into integrating the supabase auth into a medusa plugin for it to handle the auth of my frontend app built with t4
It's totally fine tho, the modular aspect of the codebase makes it easy to replace any package for whatever you want with your own dependencies, it's a marvel actually how modularly it all fits like lego's or puzzle pieces into ∑hatever you're building
For now I'll try to just re-use as much from medusa for the backend and see if I need more when I reach that.

Are you making an ecommerce app with medusa backend and t4-app frontend?

Yes, that's what I'm trying to do, looking into adding a supabase adapter to the medusa-plugin-auth repo to share auth between backend and frontend

@timothymiller
Copy link
Owner

I've added an FAQ page answering the main questions from this thread.

For additional discussion on medusa and supabase, feel free to open a thread in the Discord server.

@Boscop
Copy link

Boscop commented Aug 28, 2023

What about https://lucia-auth.com ?
They also have adapters for D1 etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants