8000 fix(login): preserve body class on OAuth grant by ShaunLinTW · Pull Request #1062 · keycloakify/keycloakify · GitHub
[go: up one dir, main page]

Skip to content

fix(login): preserve body class on OAuth grant - #1062

Open
ShaunLinTW wants to merge 1 commit into
keycloakify:mainfrom
ShaunLinTW:fix/958-oauth-body-class
Open

ShaunLinTW wants to merge 1 commit into
keycloakify:mainfrom
ShaunLinTW:fix/958-oauth-body-class

Conversation

@ShaunLinTW
@ShaunLinTW ShaunLinTW commented Sep 17, 2026 •
Copy link
Copy Markdown

LoginOauthGrant passes bodyClassName="oauth" to the shared template, which replaces the configured kcBodyClass on the OAuth consent page.

Compose the theme body class with the OAuth-specific class so custom body styling is preserved without removing the existing oauth marker or changing the global Template.bodyClassName override semantics.

Added regression coverage for both a custom kcBodyClass and the default case.

Tested with:

  • vitest run test/login/LoginOauthGrant.spec.ts
  • vitest run (31 tests)
  • tsc -p test/tsconfig.json --noEmit
  • prettier --check src/login/pages/LoginOauthGrant.tsx test/login/LoginOauthGrant.spec.ts
  • git diff --check

fixes #958

Summary by CodeRabbit

  • Bug Fixes
    • OAuth login pages now retain configured default body styling while continuing to apply OAuth-specific styling.

@coderabbitai
coderabbitai Bot commented Sep 17, 2026 •
Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: c9c9ce4f-2d61-44e7-9ce6-d05179b819f7

📥 Commits

Reviewing files that changed from the base of the PR and between 3a90463 and 68d0734.

📒 Files selected for processing (2)
  • src/login/pages/LoginOauthGrant.tsx
  • test/login/LoginOauthGrant.spec.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

LoginOauthGrant now combines the configured kcBodyClass with "oauth". New tests verify the result with and without a custom body class.

Changes

OAuth grant body class

Layer / File(s) Summary
Compose and validate body classes
src/login/pages/LoginOauthGrant.tsx, test/login/LoginOauthGrant.spec.ts
LoginOauthGrant uses clsx(kcClsx("kcBodyClass"), "oauth") for bodyClassName. Tests verify configured and default body class values.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to 68d07

The OAuth page preserves custom body styling while retaining the required OAuth class, with both supported configurations covered by tests.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: preserving the body class on the OAuth grant page.
Linked Issues check ✅ Passed The change satisfies issue #958. LoginOauthGrant.tsx now composes kcClsx("kcBodyClass") with "oauth" for bodyClassName. This preserves the configured body class and the OAuth marker. `test/log…
Out of Scope Changes check ✅ Passed The changes stay within issue #958. They modify only LoginOauthGrant.tsx and add focused regression tests for body-class composition. No unrelated behavior or files are identified.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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.

LoginOauthGrant.tsx does not apply kcBodyClass by default

1 participant

0