[PR #5028] [CLOSED] fix(sso): handle samlConfig that is already parsed as object #22627

Closed
opened 2026-04-15 21:10:53 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5028
Author: @xiaoyu2er
Created: 10/1/2025
Status: Closed

Base: canaryHead: fix_saml_config


📝 Commits (1)

  • 6b0cd40 fix(sso): handle samlConfig that is already parsed as object

📊 Changes

1 file changed (+2 additions, -1 deletions)

View changed files

📝 packages/sso/src/index.ts (+2 -1)

📄 Description

Fixes issue where provider.samlConfig could already be a JSON object (from defaultSSO config or previously parsed from database) but was being parsed again with JSON.parse(), causing runtime errors.


Summary by cubic

Prevent runtime errors in SSO by safely handling provider.samlConfig when it’s already an object. We now only JSON.parse when the value is a string.

  • Bug Fixes
    • Check samlConfig type (object vs string) and avoid double parsing; supports defaultSSO and previously parsed DB values.

🔄 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/5028 **Author:** [@xiaoyu2er](https://github.com/xiaoyu2er) **Created:** 10/1/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `fix_saml_config` --- ### 📝 Commits (1) - [`6b0cd40`](https://github.com/better-auth/better-auth/commit/6b0cd40b47c3cb55bcaaef1fff9cf1430ec5c900) fix(sso): handle samlConfig that is already parsed as object ### 📊 Changes **1 file changed** (+2 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/sso/src/index.ts` (+2 -1) </details> ### 📄 Description Fixes issue where provider.samlConfig could already be a JSON object (from defaultSSO config or previously parsed from database) but was being parsed again with JSON.parse(), causing runtime errors. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Prevent runtime errors in SSO by safely handling provider.samlConfig when it’s already an object. We now only JSON.parse when the value is a string. - **Bug Fixes** - Check samlConfig type (object vs string) and avoid double parsing; supports defaultSSO and previously parsed DB values. <!-- 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-04-15 21:10:53 -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#22627