fix: use sessionStorage instead of query param for logout flag
All checks were successful
CI / build (push) Successful in 2m2s
CI / docker (push) Successful in 1m12s

Logto does exact-match on post_logout_redirect_uri, so ?signed_out
caused "not registered" error. Use sessionStorage flag instead —
set before signOut, read and cleared on LoginPage mount.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-25 19:56:10 +02:00
parent 2cb818ec71
commit 400c32a539
2 changed files with 6 additions and 4 deletions

View File

@@ -9,10 +9,11 @@ export function LoginPage() {
const navigate = useNavigate();
const redirected = useRef(false);
// Check if we arrived here from a logout redirect
// Check if we arrived here from a logout redirect (set by useAuth before signOut)
const [signedOut] = useState(() => {
const params = new URLSearchParams(window.location.search);
return params.has('signed_out');
const flag = sessionStorage.getItem('cameleer:signed_out');
if (flag) sessionStorage.removeItem('cameleer:signed_out');
return !!flag;
});
useEffect(() => {

View File

@@ -7,7 +7,8 @@ export function useAuth() {
const { currentTenantId } = useOrgStore();
const logout = useCallback(() => {
signOut(window.location.origin + '/platform/login?signed_out');
sessionStorage.setItem('cameleer:signed_out', '1');
signOut(window.location.origin + '/platform/login');
}, [signOut]);
return {