fix(saml): reject signInWithSaml when redirectMethod is "none"

Previously the call would no-op the redirect and then await neverResolve(),
hanging the caller forever. Throw an explicit error instead so the misuse
surfaces immediately.
This commit is contained in:
Bilal Godil 2026-05-01 09:56:50 -07:00
parent be4560b416
commit fdfc400027

View File

@ -2866,6 +2866,9 @@ export class _StackClientAppImplIncomplete<HasTokenStore extends boolean, Projec
if (typeof window === "undefined") {
throw new Error("signInWithSaml can currently only be called in a browser environment");
}
if (this._redirectMethod === "none") {
throw new Error("signInWithSaml requires a redirectMethod that performs navigation; got 'none'");
}
this._ensurePersistentTokenStore();
const currentUrl = new URL(window.location.href);
const afterCallbackRedirectUrl = options.returnTo != null