Flutter refuses me to use the API
Closed this issue · 1 comments
Hello,
im using the standard app.js and added cors() app.use(cors());
and https https.createServer(options, app).listen(8001);
(https on last line)
my options:
var options = { cert: fs.readFileSync("ssl/fullchain.pem"), key: fs.readFileSync("ssl/privkey.pem") };
I set up everything on my vServer. Since 2 days Im just trying to log in from flutter web (dio await dio.request('https://mydomain.com:8001/auth/steam', options: Options(method: "GET"));
Tried to set the header to 'origin: *' and everything stackoverflow offered me.
This is the error:
Access to XMLHttpRequest at 'https://steamcommunity.com/openid/login? *cutted away for readability*' (redirected from 'https://mydomain.com:8001/auth/steam') from origin 'https://mydomain.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Maybe its a small issue, but its driving me crazy... :/
Had someone else this issue too?
No issue...
Im just dumb.
Instead of calling a .get() I had to use the launchUrl Widget.