Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

fix: show error for sso

Marc Seitza677c3165137
diff --git a/app/(ee)/api/auth/saml/verify/route.ts b/app/(ee)/api/auth/saml/verify/route.ts
index 1cd3d1cd..22b2e9ed 100644
--- a/app/(ee)/api/auth/saml/verify/route.ts
+++ b/app/(ee)/api/auth/saml/verify/route.ts
@@ -31,19 +31,13 @@ export async function POST(req: Request) {
select: { id: true, ssoEnabled: true },
});
- if (!team) {
- // Generic error — don't reveal whether team exists
- return NextResponse.json(
- { error: "SSO is not configured for this team." },
- { status: 404 },
- );
- }
+ const ssoUnavailable = NextResponse.json(
+ { error: "SSO is not available for this team." },
+ { status: 404 },
+ );
- if (!team.ssoEnabled) {
- return NextResponse.json(
- { error: "SSO is not enabled for this team." },
- { status: 404 },
- );
+ if (!team || !team.ssoEnabled) {
+ return ssoUnavailable;
}
// Check Jackson for actual SAML connections
@@ -55,10 +49,7 @@ export async function POST(req: Request) {
});
if (!connections || connections.length === 0) {
- return NextResponse.json(
- { error: "No SSO connections found for this team." },
- { status: 404 },
- );
+ return ssoUnavailable;
}
// Only return the team ID — no names, providers, or other metadata