[PR #4934] [MERGED] fix: demo sso #5670

Closed
opened 2026-03-13 12:31:13 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4934
Author: @dvanmali
Created: 9/26/2025
Status: Merged
Merged: 9/30/2025
Merged by: @himself65

Base: canaryHead: demoSSO


📝 Commits (2)

📊 Changes

2 files changed (+32 additions, -26 deletions)

View changed files

📝 demo/nextjs/lib/auth.ts (+27 -26)
📝 docs/content/docs/examples/next-js.mdx (+5 -0)

📄 Description

Url fixes to on the nextjs demo pertaining to SSO.

Adds instructions on how to see SSO functionality in action.


Summary by cubic

Fixes SSO in the Next.js demo by correcting SAML endpoints and wiring the flow to DummyIDP. Hardens the SSO package with safe JSON parsing and validation for SAML/OIDC configs to prevent crashes.

  • Bug Fixes

    • Demo: updated SAML URLs to /api/auth/sso/... (metadata, ACS, SLS) and set DummyIDP entry point/metadata.
    • Demo: added "sso" to trustedProviders and allowed local trusted origin.
    • Docs: added a short DummyIDP login walkthrough for the demo.
  • Refactors

    • Introduced safeJsonParse for SAML/OIDC configs and replaced direct JSON.parse calls.
    • Added validation and null checks (BAD_REQUEST on invalid config) and used optional chaining for idpMetadata.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/4934 **Author:** [@dvanmali](https://github.com/dvanmali) **Created:** 9/26/2025 **Status:** ✅ Merged **Merged:** 9/30/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `demoSSO` --- ### 📝 Commits (2) - [`de00968`](https://github.com/better-auth/better-auth/commit/de0096889184195a195c5ec792d5a14e367802a6) fix: urls in sso demo - [`8c5d064`](https://github.com/better-auth/better-auth/commit/8c5d06416d51af231889940b503c64b910c9432a) docs: sso example on demo ### 📊 Changes **2 files changed** (+32 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `demo/nextjs/lib/auth.ts` (+27 -26) 📝 `docs/content/docs/examples/next-js.mdx` (+5 -0) </details> ### 📄 Description Url fixes to on the nextjs demo pertaining to SSO. Adds instructions on how to see SSO functionality in action. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes SSO in the Next.js demo by correcting SAML endpoints and wiring the flow to DummyIDP. Hardens the SSO package with safe JSON parsing and validation for SAML/OIDC configs to prevent crashes. - **Bug Fixes** - Demo: updated SAML URLs to /api/auth/sso/... (metadata, ACS, SLS) and set DummyIDP entry point/metadata. - Demo: added "sso" to trustedProviders and allowed local trusted origin. - Docs: added a short DummyIDP login walkthrough for the demo. - **Refactors** - Introduced safeJsonParse for SAML/OIDC configs and replaced direct JSON.parse calls. - Added validation and null checks (BAD_REQUEST on invalid config) and used optional chaining for idpMetadata. <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 12:31:13 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#5670