firebase-subscription-payments icon indicating copy to clipboard operation
firebase-subscription-payments copied to clipboard

STRIPE CORS Error - "Response to preflight request doesn't pass access control check"

Open killiangemoets opened this issue 2 years ago • 2 comments

Hi there,

I'm working with ReactJS for the frontend and ExpressJS for the backend. I've a problem with the fetch on the overviewPage.js component. I do a post request to my backend to do a redirection to Stripe but this redirection doesn't work since I've a CORS error. I already to solve this error by using to cors module in my backend but it didn't solve anything.

Does anyone is able to help me please ??

Thank you!

Killian

https://github.com/killiangemoets/TieBreak

Screenshots from app.js and index.js (backend), and overviewPage.js (frontend)

Capture2 Capture3 Capture1

killiangemoets avatar May 19 '22 12:05 killiangemoets

Related PR

labnol avatar Nov 13 '22 08:11 labnol

You can fix this issue by changing line 215 in app.js from

.httpsCallable('ext-firestore-stripe-subscriptions-createPortalLink');

to

.httpsCallable('ext-firestore-stripe-payments-createPortalLink');

See https://github.com/stripe-samples/firebase-subscription-payments/pull/47#issuecomment-1312672555

bensontrent avatar Feb 19 '23 23:02 bensontrent