Skip to content

Commit d956672

Browse files
roymilohclaude
andcommitted
Fix postMessage origin check to use current window origin
The popup sends its message after the backend redirects it back to our app's domain, so event.origin is window.location.origin, not the Base44 server's origin. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 4a3ddcf commit d956672

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/modules/auth.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,7 @@ export function createAuthModule(
151151
// use a popup to avoid OAuth providers blocking iframe navigation.
152152
if (isPopupAuthDomain()) {
153153
const popupLoginUrl = `${loginUrl}&popup_origin=${encodeURIComponent(window.location.origin)}`;
154-
return loginViaPopup(
155-
popupLoginUrl,
156-
redirectUrl,
157-
new URL(options.appBaseUrl).origin
158-
);
154+
return loginViaPopup(popupLoginUrl, redirectUrl, window.location.origin);
159155
}
160156

161157
// Default: full-page redirect

0 commit comments

Comments
 (0)