[PR #6550] [MERGED] fix(sso): safely parse provider configs on registration #6739

Closed
opened 2026-03-13 13:10:02 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6550
Author: @Paola3stefania
Created: 12/5/2025
Status: Merged
Merged: 12/8/2025
Merged by: @Bekacru

Base: canaryHead: fix/sso-json-parse-4862


📝 Commits (4)

  • a980734 fix: json parse config
  • 94ee8b7 Merge branch 'canary' into fix/sso-json-parse-4862
  • 991ea62 chore: lint
  • fd8aa2f Merge branch 'canary' into fix/sso-json-parse-4862

📊 Changes

3 files changed (+217 additions, -33 deletions)

View changed files

📝 packages/sso/src/routes/sso.ts (+5 -33)
📝 packages/sso/src/saml.test.ts (+181 -0)
📝 packages/sso/src/utils.ts (+31 -0)

📄 Description


Summary by cubic

Safely parse SAML and OIDC provider configs during registration, handling both JSON strings and pre-parsed objects. This prevents runtime errors and ensures configs are returned as proper objects.

  • Bug Fixes
    • Replace JSON.parse with safeJsonParse for oidcConfig and samlConfig in registerSSOProvider.
    • Handle ORM-returned objects from TEXT/JSON columns and avoid “[object Object]” in responses.
    • Add tests for safeJsonParse and provider registration responses.

Written for commit fd8aa2fb96. Summary will update automatically on new commits.

https://github.com/better-auth/better-auth/issues/4862 fix


🔄 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/6550 **Author:** [@Paola3stefania](https://github.com/Paola3stefania) **Created:** 12/5/2025 **Status:** ✅ Merged **Merged:** 12/8/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `fix/sso-json-parse-4862` --- ### 📝 Commits (4) - [`a980734`](https://github.com/better-auth/better-auth/commit/a9807343afbb3bcfce1fe5617acb9459cc4ae3f3) fix: json parse config - [`94ee8b7`](https://github.com/better-auth/better-auth/commit/94ee8b7deb6f82a1c52938973c1357fffbefcd34) Merge branch 'canary' into fix/sso-json-parse-4862 - [`991ea62`](https://github.com/better-auth/better-auth/commit/991ea62d1b6912f06f3ea52fc3439417f3f19e2a) chore: lint - [`fd8aa2f`](https://github.com/better-auth/better-auth/commit/fd8aa2fb969e23acfdb4ffda4eea9d9b97266c3d) Merge branch 'canary' into fix/sso-json-parse-4862 ### 📊 Changes **3 files changed** (+217 additions, -33 deletions) <details> <summary>View changed files</summary> 📝 `packages/sso/src/routes/sso.ts` (+5 -33) 📝 `packages/sso/src/saml.test.ts` (+181 -0) 📝 `packages/sso/src/utils.ts` (+31 -0) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Safely parse SAML and OIDC provider configs during registration, handling both JSON strings and pre-parsed objects. This prevents runtime errors and ensures configs are returned as proper objects. - **Bug Fixes** - Replace JSON.parse with safeJsonParse for oidcConfig and samlConfig in registerSSOProvider. - Handle ORM-returned objects from TEXT/JSON columns and avoid “[object Object]” in responses. - Add tests for safeJsonParse and provider registration responses. <sup>Written for commit fd8aa2fb969e23acfdb4ffda4eea9d9b97266c3d. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. --> https://github.com/better-auth/better-auth/issues/4862 fix --- <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 13:10:02 -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#6739