fix(front): tolérer messages si origin OK même si source !== iframeRef (postMessage)
All checks were successful
build-and-push-ext / build_push (push) Successful in 59s

This commit is contained in:
Debian Dev4 2025-09-18 16:39:50 +00:00
parent 6ad0b5c339
commit 6cfeb5cab8

View File

@ -31,12 +31,13 @@ export default function AuthModal({ isOpen, onClose }: AuthModalProps) {
return;
}
if (event.source !== iframeRef.current.contentWindow) {
const targetOrigin = IframeReference.getTargetOrigin();
const fromIframe = event.source === iframeRef.current.contentWindow;
const sameOrigin = event.origin === targetOrigin;
if (!fromIframe && !sameOrigin) {
console.error('[AuthModal] handleMessage: source not match');
return;
}
const targetOrigin = IframeReference.getTargetOrigin();
if (!targetOrigin) {
console.error('[AuthModal] handleMessage: targetOrigin not found');
return;