OkunaOrg / okuna-web

🌈 Okuna for the web.
https://okuna.io
MIT License
67 stars 25 forks source link

After installation, login returns error #53

Closed alsiPanda closed 4 years ago

alsiPanda commented 4 years ago

I was able to install the current okuna-web on my Google cloud. Since my okuna-api is also on this server, I added some lines to nuxt.config with host: "0.0.0.0", port: "8080". After npm run dev, the page starts to load, albeit very slowly, and later login gives an error. The error shown within npm run dev is

ERROR (node:6813) [DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the A syncResource class instead. (Use node --trace-deprecation ... to show where the warning was created)

I have tried connecting to my local api as well as the api.openbook.social via .env but both giving the same error.

@Komposten , @lifenautjoe

alsiPanda commented 4 years ago

@lifenautjoe are their additional steps to be taken during setup not mentioned in the installation guide ?

jozsefsallai commented 4 years ago

Hello!

Are you setting this up to contribute to the development? okuna-web isn't production-ready yet, so we don't have a proper deployment guide yet. With that being said, the warning that shows up in the terminal is irrelevant. What I'd rather want to see is the errors that are being thrown in your browser's console, so it would be neat if you could provide a screenshot of that!

alsiPanda commented 4 years ago

@jozsefsallai This is the error on console when trying to login - Access to XMLHttpRequest at 'http://35.***.***.190/api/auth/login/' from origin 'http://35.***.***.190:8080' 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. As mentioned earlier, i have setup the api on port 80, and okuna-web on port 8080.

When switch the api to https://api.openbook.social I get the same result - Access to XMLHttpRequest at 'https://api.openbook.social/api/auth/login/' from origin 'http://35.***.***.190:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The 'Access-Control-Allow-Origin' header has a value 'https://www.openbook.social' that is not equal to the supplied origin.

Do i need to change any particular settings on my server or the files ?

jozsefsallai commented 4 years ago

This behavior is expected, since neither the web frontend, nor the API are configured to interact with each other. As a temporary workaround, you could try using the proxy that is provided (API_URL=/local in your .env). This will use the production API but if you want to use your own, you can change the URL here: https://github.com/OkunaOrg/okuna-web/blob/master/nuxt.config.ts#L109