<p></p>
<p dir="auto">Right so this isn't really CORS as such - that is where loading a resource is rejected because the resource has a CORS policy that prevents a cross origin load.</p>
<p dir="auto">What is happening here is that the the popup is successfully redirecting back to the 127.0.0.1 URL but then tries to make a function call on the parent window and that is rejected the parent window has a different origin to the popup at that point.</p>
<p dir="auto">If you had actually visited <a href="http://127.0.0.1:3000/" rel="nofollow">http://127.0.0.1:3000/</a> originally then everything would have worked and this setup (using a popup for the authentication) is tricky in general when there are multiple names for the site because you have to make sure the callback matches the name the user used to access the site.</p>
<p dir="auto">I think a workaround would be for the callback to reload/redirect to the preferred name before making the function call to the parent - so if the callback knows the application was accessed as localhost but it is loaded as 127.0.0.1 then it reloads to localhost and only then does the function call.</p>
<p dir="auto">We can consider allowing HTTP to localhost but I need to think if there are any security implications, because there is no guarantee that localhost resolves to a loopback address.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/issues/3613#issuecomment-1192447915">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLOBIITWF3JXKLBUT63VVJ4UTANCNFSM54KGTK4A">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLMPCOJQFA6TL5HUJHTVVJ4UTA5CNFSM54KGTK4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOI4JU7KY.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/issues/3613/1192447915</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/issues/3613#issuecomment-1192447915",
"url": "https://github.com/openstreetmap/openstreetmap-website/issues/3613#issuecomment-1192447915",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>