-
Notifications
You must be signed in to change notification settings - Fork 89
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
Supabaseify #1
Supabaseify #1
Conversation
thorwebdev
commented
Jul 5, 2023
•
edited
Loading
edited
- 🔐 nextauth -> Supabase Auth
- 💽 KV -> Postgres with RLS
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' | ||
} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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