Skip to content

Add support for OAuth (Keycloak)#57

Merged
13Bytes merged 6 commits intomainfrom
oauth
Mar 15, 2026
Merged

Add support for OAuth (Keycloak)#57
13Bytes merged 6 commits intomainfrom
oauth

Conversation

@13Bytes
Copy link
Owner

@13Bytes 13Bytes commented Mar 15, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 15, 2026 21:36
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-policy field 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(),
})
}
@13Bytes 13Bytes merged commit 303ede6 into main Mar 15, 2026
5 checks passed
@13Bytes 13Bytes deleted the oauth branch March 15, 2026 22:04
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.

2 participants