rohit-chouhan / email_otp

A fast & simple email authentication OTP sender and verification flutter package.
https://pub.dev/packages/email_otp
MIT License
13 stars 5 forks source link

blocked by CORS policy: #21

Closed kamesh7773 closed 2 months ago

kamesh7773 commented 3 months ago

In Android and iOS, the OTP is received successfully, but on Flutter Web, I encounter this error:

"Access to XMLHttpRequest at 'https://email-otp.api.rohitchouhan.com/v2/' from origin 'https://authentication-2be47.web.app/' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource."

Initially, I thought this error occurred because my Flutter web application was running on a local server. However, after hosting my Flutter web application on Firebase, I am still getting the same error. It seems the backend of the email OTP package is not allowing requests from unlisted URLs. Screenshot_1

rohit-chouhan commented 2 months ago

Cross allow in all server and fixed.