Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds optional Keycloak authentication support (alongside conditional LDAP credentials login) to the existing NextAuth + Prisma setup, including the Prisma schema changes needed for Keycloak account payloads and UI updates on the sign-in page.
Changes:
- Add Keycloak provider support in NextAuth and extend the Prisma adapter to drop Keycloak’s incompatible
not-before-policyfield on account linking. - Make LDAP and Keycloak providers conditionally enabled based on environment variables.
- Update the login page UI to expose Keycloak/Credentials/Magic Link flows via tabs, and add required env/schema/migration updates.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
src/server/auth.ts |
Adds Keycloak provider + conditional providers and custom adapter behavior for Keycloak account linking. |
src/pages/index.tsx |
Updates sign-in UI to support Keycloak and conditionally show login methods. |
src/env.mjs |
Introduces Keycloak env vars to validation and process env mapping. |
prisma/schema.prisma |
Adds refresh_expires_in to NextAuth Account model for Keycloak compatibility. |
prisma/migrations/20260309225029_add_refresh_expires_in_for_keycloak/migration.sql |
DB migration to add the new refresh_expires_in column. |
.env.example |
Documents Keycloak environment variables. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
+264
to
+273
| {activeTab === "keycloak" && ( | ||
| <div className="space-y-3"> | ||
| <button | ||
| type="button" | ||
| className="btn btn-outline w-full" | ||
| onClick={() => | ||
| void signIn("keycloak", { | ||
| callbackUrl: new URL("/buy", window.location.origin).toString(), | ||
| }) | ||
| } |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.