rohit-chouhan / email_otp

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

Access to XMLHttpRequest at 'https://flutter.rohitchouhan.com/email-otpV2/v2.php' from origin 'http://localhost:9839' 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. #27

Open muditgarg48 opened 2 months ago

muditgarg48 commented 2 months ago

I am utilising your package to send OTP to the user's entered email address but it is giving me the CORS access error. I cannot upgrade the package from email_opt 2.0.1 to the latest one since then many dependencies need to be modified due to email_otp latest version relying on newer version of https package. Can you see if you could incorporate the CORS permission on your older version as well. Here is the error:

Access to XMLHttpRequest at 'https://flutter.rohitchouhan.com/email-otpV2/v2.php' from origin 'http://localhost:9839' 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.

POST https://flutter.rohitchouhan.com/email-otpV2/v2.php net::ERR_FAILED

Uncaught (in promise) Error at Object.createErrorWithStack (errors.dart:329:10) at Error._throw (core_patch.dart:265:28) at Error.throwWithStackTrace (errors.dart:120:5) at async._AsyncCallbackEntry.new.callback (zone.dart:1386:11) at Object._microtaskLoop (schedule_microtask.dart:40:11) at _startMicrotaskLoop (schedule_microtask.dart:49:5) at async_patch.dart:181:7

image

Abi2737 commented 1 month ago

i have the same error on version 3.0.2. @rohit-chouhan could you please allow CORS in backend so that we can use your package on web as well?