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

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

Closed
wants to merge 5 commits into from

Conversation

daniel-farina
Copy link
Collaborator

@daniel-farina daniel-farina commented Nov 22, 2023

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

Tasks:

  • removed next-auth references and libraries
  • updated db migration
  • update .env sample
  • update docs (might need more revisions)
  • add login/logout
  • add google enabled by default
  • refactored helper

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.

Copy link

vercel bot commented Nov 22, 2023

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
Copy link
Collaborator

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
Copy link
Collaborator Author

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?

@sebiweise
Copy link
Collaborator

sebiweise commented Nov 22, 2023

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
Copy link
Owner

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

Closing this in favor of #105

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

Successfully merging this pull request may close these issues.

3 participants