Skip to content

Conversation

@thorwebdev
Copy link

@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
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
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

3 participants