Skip to content

Commit be4db0b

Browse files
committed
chore(sso): normalize the caught error when a launch sign-in fails
1 parent 73dec08 commit be4db0b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • apps/sim/app/(auth)/sso/launch/[providerId]

‎apps/sim/app/(auth)/sso/launch/[providerId]/route.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { createLogger } from '@sim/logger'
2+
import { toError } from '@sim/utils/errors'
23
import { type NextRequest, NextResponse } from 'next/server'
34
import { auth, getSession } from '@/lib/auth'
45
import { isIdpInitiatedLoginAllowed } from '@/lib/auth/sso/idp-initiated-login'
@@ -66,7 +67,7 @@ export const GET = withRouteHandler(async (request: NextRequest, context: RouteC
6667
asResponse: true,
6768
})
6869
} catch (error) {
69-
logger.error('SSO sign-in could not be started', { providerId, error })
70+
logger.error('SSO sign-in could not be started', { providerId, error: toError(error) })
7071
return NextResponse.redirect(errorCallbackURL)
7172
}
7273
const payload = (await signIn.json().catch(() => null)) as { url?: string } | null

0 commit comments

Comments
 (0)