jorge-menjivar / unsaged

Open source chat kit engineered for seamless interaction with AI models.
https://unsaged.com
Apache License 2.0
247 stars 77 forks source link

Move from next-auth to supabase-auth - WIP #97

Closed daniel-farina closed 9 months ago

daniel-farina commented 9 months ago

This PR moves this project away from next-auth to supabase-auth. This makes the configuration a lot simpler.

Tasks:

Now the application works immediately once supabase is configured, you can login with magic links, no need to setup smtp providers.

Todo

The login by *@email feature has been removed, we might want to add that again

Upgrading

This PR works on a brand new installation only, We might need to add a migration script to migrate users form next-auth to supabase-auth. The auth table is already available by default in supabase, I think it would just be a matter of moving users from next-auth table to auth table and then updating all the db changes seen here: https://github.com/jorge-menjivar/unSAGED/pull/97/files#diff-8afbaed08ea2245ce9c16b9011699a8f683c2618a6f1d4e88d243028204a4aa5 another option is to export all data, run the application from scratch then import data back.

vercel[bot] commented 9 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unsaged ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 23, 2023 1:04am
unsaged-docs ❌ Failed (Inspect) Nov 23, 2023 1:04am
sebiweise commented 9 months ago

Hi Daniel, you can have a look at PR #95 I´ve done some updates that can be adopted in your WIP. Maybe it would be possible to implement supabase-auth and Clerk for the users who want to use Clerk?

daniel-farina commented 9 months ago

Hi Daniel, you can have a look at PR #95 I´ve done some updates that can be adopted in your WIP. Maybe it would be possible to implement supabase-auth and Clerk for the users who want to use Clerk?

Amazing, doing supabase auth + Clerk would be the best outcome. What do you think would be the best way to merge both? Maybe cherry pick your Clerk changes and add them as a separate PR to make sure we have clear history of:

Clerk should be conditional where a user can select supabase or clerk via an environment variable. I could probably look into this.

Looking at your PR it has a ton of changes. I think it would be a lot better to break them down into parts: -AI model changes -Clerk Support -Turbo refactoring

Else it becomes a little difficult to merge, thoughts?

sebiweise commented 9 months ago

Hi Daniel, you can have a look at PR #95 I´ve done some updates that can be adopted in your WIP. Maybe it would be possible to implement supabase-auth and Clerk for the users who want to use Clerk?

Amazing, doing supabase auth + Clerk would be the best outcome. What do you think would be the best way to merge both? Maybe cherry pick your Clerk changes and add them as a separate PR to make sure we have clear history of:

  • adding supabase-auth
  • adding Clerk

Clerk should be conditional where a user can select supabase or clerk via an environment variable. I could probably look into this.

Looking at your PR it has a ton of changes. I think it would be a lot better to break them down into parts: -AI model changes -Clerk Support -Turbo refactoring

Else it becomes a little difficult to merge, thoughts?

I just reverted my clerk changes, I will just push my clerk_auth branch to this repo so you can have a look at the changes I´ve made, maybe it is helpful for the future changes. https://github.com/jorge-menjivar/unSAGED/tree/sebiweise/clerk-auth

jorge-menjivar commented 9 months ago

I will merge #99 in for now so that new pull requests start building on top of that since it is a significant change. We will need to update this work so that it is on top of these changes. I will get started on building the desktop app on top of the refactored changes as well.

daniel-farina commented 9 months ago

I will merge #99 in for now so that new pull requests start building on top of that since it is a significant change. We will need to update this work so that it is on top of these changes. I will get started on building the desktop app on top of the refactored changes as well.

sounds good!

daniel-farina commented 9 months ago

Closing this in favor of https://github.com/jorge-menjivar/unsaged/pull/105