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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supabaseify #1

Merged
merged 5 commits into from Jul 7, 2023
Merged

Supabaseify #1

merged 5 commits into from Jul 7, 2023

Conversation

thorwebdev
Copy link
Collaborator

@thorwebdev thorwebdev commented Jul 5, 2023

  • 馃攼 nextauth -> Supabase Auth
  • 馃捊 KV -> Postgres with RLS

Comment on lines -14 to -34
export const {
handlers: { GET, POST },
auth,
CSRF_experimental
} = NextAuth({
providers: [GitHub],
callbacks: {
jwt({ token, profile }) {
if (profile) {
token.id = profile.id
token.image = profile.picture
}
return token
},
authorized({ auth }) {
return !!auth?.user
}
},
pages: {
signIn: '/sign-in'
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to call out a potential issue - these are actual config/UX choices https://github.com/vercel-labs/ai-chatbot/pull/90/files i think you have mostly addressed them (except for the forced signin?) but just proactively calling it out

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah interesting, their deployed demo actually allows anonymous conversations without requiring you to log in. But yah, happy to add a middleware based redirect if user isn't logged in, is that your preference?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, added here with an comment that it's optional: 842803c

@thorwebdev thorwebdev changed the title [WIP]: Supabaseify Supabaseify Jul 7, 2023
@thorwebdev thorwebdev merged commit 2a68048 into main Jul 7, 2023
@thorwebdev thorwebdev deleted the supabaseify branch July 7, 2023 08:42
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.

None yet

2 participants