-
Notifications
You must be signed in to change notification settings - Fork 35
Update/supabase #448
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
Update/supabase #448
Conversation
WalkthroughThe integration guide for Kinde and Supabase with Next.js was updated for clarity and correctness. Key changes include improved documentation, renamed and refactored authentication components, relocation and rewriting of Supabase client logic, new middleware for session updates, consolidation of example components, and adjustments to environment variables and URLs. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant AuthButton
participant SupabaseServerClient
participant Middleware
User->>AuthButton: Clicks Sign In/Sign Out
AuthButton->>SupabaseServerClient: Checks session, renders UI
User->>AuthButton: Interacts (sign in/sign out)
AuthButton->>SupabaseServerClient: Triggers authentication
SupabaseServerClient->>Middleware: updateSession(request)
Middleware-->>SupabaseServerClient: Returns updated response
SupabaseServerClient-->>AuthButton: Session updated
AuthButton-->>User: Updates UI (greeting or auth buttons)
Possibly related PRs
Suggested reviewers
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/content/docs/integrate/third-party-tools/kinde-supabase.mdx (2)
195-244
: Supabase server client setup with JWT integration.
ThecreateClient
function properly signs the Kinde ID token and falls back to the anon key. As an optional enhancement, consider using the Supabase service role key for server-side operations that require elevated privileges while still preserving RLS protections.
294-361
: Hero component example added.
TheHero
component correctly fetches and renders the todo list. Verify your import alias (@/lib/supabase/server
) is defined in your Next.js configuration. Optionally, extract the inline styles into reusable CSS classes or Tailwind utility classes for better maintainability.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/content/docs/integrate/third-party-tools/kinde-supabase.mdx
(4 hunks)
🔇 Additional comments (5)
src/content/docs/integrate/third-party-tools/kinde-supabase.mdx (5)
130-131
: Consistent path quoting in code examples.
Using quoted paths for themkdir
andtouch
commands improves readability and avoids shell parsing issues.
149-149
: Clarified Supabase environment variable sources.
Separating the Data API URL and the Anon public key makes the instructions more precise and reduces ambiguity for new users.
162-193
: Updated authentication UI component snippet.
The newAuthButton
implementation is concise and correctly leveragesgetKindeServerSession
. Please verify thatcomponents/auth-button.tsx
uses the.tsx
extension and that your Next.js path alias (@kinde-oss/kinde-auth-nextjs
) is configured intsconfig.json
ornext.config.js
.
245-282
: ValidatehasEnvVars
usage in middleware.
Ensure thathasEnvVars
is a boolean constant; if it’s a function, update the check toif (!hasEnvVars())
. Otherwise the middleware skip logic may not behave as expected.
369-371
: Post-login redirect URL updated.
The.env.local
snippet now redirects users to/
after login, aligning with the relocated to-do example.
Description (required)
Updated the Supabase integration doc to reflect the new boilerplate changes.
Related issues & labels (optional)
Summary by CodeRabbit
Documentation
Refactor