magic-js icon indicating copy to clipboard operation
magic-js copied to clipboard

Add ‘Cross-Origin-Resource-Policy: cross-origin’ to response headers

Open Gnorme opened this issue 1 year ago • 3 comments

✅ Prerequisites

  • [ ✅ ] Did you perform a cursory search of open issues? Is this feature already requested elsewhere?
  • [ ✅ ] Are you reporting to the correct repository (magic-sdk)?

✨ Feature Request

Add ‘Cross-Origin-Resource-Policy: cross-origin’ to the response headers of requests. This would enable Magic SDK to be used on cross-origin isolated pages.

🧩 Context

The ‘Cross-Origin-Resource-Policy' response header is not set to anything for requests made using magic-sdk. I currently can’t use magic.user.getInfo() or similar requests on my page because it needs to be cross-origin isolated to use FFmpeg.wasm.

Gnorme avatar Jun 11 '23 22:06 Gnorme

Hi @Gnorme ,

Thank you for reporting this feature request. We will follow up with you here when we have an update to share!

Thank you!

am-hernandez avatar Jun 12 '23 19:06 am-hernandez

@Gnorme, please navigate to the settings of your Magic app under the Content Security Policy section, and add the URL in question. This may resolve your issue. Screenshot 2023-10-16 at 4 01 26 PM

ayv8er avatar Oct 16 '23 21:10 ayv8er

@Gnorme, please navigate to the settings of your Magic app under the Content Security Policy section, and add the URL in question. This may resolve your issue.

This did not solve my issue. I'm still getting: Screenshot 2023-11-08 at 5 04 25 PM

My solution has been to issue a DID Token and store it in local storage before navigating to the cross-origin isolated page. Then I use the DID Token server-side to verify the user.

Gnorme avatar Nov 09 '23 01:11 Gnorme