Fix infinitely nested login iframes when the restricted app notices it needs login.

This commit is contained in:
2025-12-04 03:56:17 +00:00
parent 9976e05696
commit 1782547b9e
+3 -8
View File
@@ -228,16 +228,11 @@ export async function apiFetch(url, options = {}) {
// If we can't parse JSON, no iframe available // If we can't parse JSON, no iframe available
} }
if (authInfo?.iframe) { // Authenticate via iframe (if not already in a frame, and no existing #auth-iframe)
// If an auth iframe is already open (from app or another request), don't open another if (authInfo?.iframe && window === window.top && !isAuthIframeOpen()) {
// Just return the response so the caller can handle it
if (isAuthIframeOpen()) {
return response
}
// Show auth iframe and wait for success (throws AuthCancelledError on cancel) // Show auth iframe and wait for success (throws AuthCancelledError on cancel)
await showAuthIframe(authInfo.iframe) await showAuthIframe(authInfo.iframe)
// Loop to retry the original request continue // Retry the original request
continue
} }
} }