When using the JavaScript SDK to enable client side OAuth flow, I'm running into this issue: Uncaught TypeError: Cannot read properties of null (reading 'postMessage')
And the page gets stuck with the message Authorizing Application.
Steps to reproduce —
- Go to: https://api.stackexchange.com/docs/js-lib
- Scroll all the way down and click on the
Run Example With Version 2.3
button - Click on
Approve
to authorize your account
This is impacting my app as described here — Customizable, short URLs for Stack Overflow profiles
cross-origin-opener-policy
header set tosame-origin-allow-popups
.window.opener
gets nulled, and thus the code attempting to callpostMessage
, assuming that opener reference is available, tries to call it and crashes.