We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3f3efc9 commit 76381ffCopy full SHA for 76381ff
1 file changed
apps/sim/lib/auth/auth.ts
@@ -687,6 +687,12 @@ export const auth = betterAuth({
687
...SSO_TRUSTED_PROVIDERS,
688
],
689
},
690
+ // Mothership/headless OAuth links are generated server-side via auth.api.oAuth2LinkAccount,
691
+ // so better-auth's signed `state` cookie is set on the server-to-server response and never
692
+ // reaches the user's browser. With the database state strategy, the callback would then fail
693
+ // with state_security_mismatch (`?error=state_mismatch`). The DB verification record + PKCE
694
+ // still bind the flow, so skip the additional browser-cookie check.
695
+ skipStateCookieCheck: true,
696
697
socialProviders: {
698
...(!isGithubAuthDisabled && {
0 commit comments