BuzzerBeater Forums

BBAPI Support > CORS preventing me from loging

CORS preventing me from loging

Set priority
Show messages by
From: simba

This Post:
00
311630.2 in reply to 311630.1
Date: 09/27/2021 13:45:40
mamelete
IV.46
Overall Posts Rated:
12781278
Second Team:
mamelete II
Hi BBs,

I'm trying to build an app on the bbapi but I can't even login, having a CORS error. It looks like it's something that could be worked around with a proxy, but my app is front-end only so that's not an option.

1) Why are you puting some CORS protection on this public API since a login name/password is required ?
2) Is there a solution to access the API with a front-end application ?



what programming lenguage are you using?

there are ways to solve it. this is a php example

https://victorroblesweb.es/2017/04/23/cabeceras-http-php-permitir-acceso-cors/

Yo no pacto, nos vemos en las canchas.
From: simba

This Post:
00
311630.4 in reply to 311630.3
Date: 09/27/2021 14:45:38
mamelete
IV.46
Overall Posts Rated:
12781278
Second Team:
mamelete II
I don’t know react, we program with angular. I’m sure there are solutions in stackoverflow.

https://stackoverflow.com/questions/46337471/how-to-allow-cors-in-react-js

Last edited by simba at 09/27/2021 14:50:16

Yo no pacto, nos vemos en las canchas.
From: simba

This Post:
00
311630.6 in reply to 311630.5
Date: 09/28/2021 04:32:29
mamelete
IV.46
Overall Posts Rated:
12781278
Second Team:
mamelete II
I don’t know react, we program with angular. I’m sure there are solutions in stackoverflow.

https://stackoverflow.com/questions/46337471/how-to-allow-cors-in-react-js

Thanks my friend but I already looked it up and apparently all solutions that are not development-only are back-end solutions.


Perhaps a solution could be a intermediate PHP, then you'll consume the PHP WS from react

Yo no pacto, nos vemos en las canchas.
From: simba

This Post:
11
311630.8 in reply to 311630.7
Date: 09/28/2021 12:20:54
mamelete
IV.46
Overall Posts Rated:
12781278
Second Team:
mamelete II
I don’t know react, we program with angular. I’m sure there are solutions in stackoverflow.

https://stackoverflow.com/questions/46337471/how-to-allow-cors-in-react-js

Thanks my friend but I already looked it up and apparently all solutions that are not development-only are back-end solutions.


Perhaps a solution could be a intermediate PHP, then you'll consume the PHP WS from react

Well, I don't think it needs to be PHP, just back-end (it could be Node). But I'm baffled by the fact that a back-end is needed to consume the BB API.


of course, it doesn`t. good luck

Yo no pacto, nos vemos en las canchas.
From: sleet

This Post:
00
311630.9 in reply to 311630.7
Date: 12/08/2021 18:43:30
Village Idiots
II.1
Overall Posts Rated:
6969
Second Team:
Tranquility Base
I've got it working in Node with the axios library. I ran into CORS issues originally as well but there are ways around it.

(https://zetcode.com/javascript/axios/)