Skip to content
This repository has been archived by the owner on Jan 6, 2020. It is now read-only.

OPTIONS on /auth returns with 401 #194

Open
gnunicorn opened this issue Jul 18, 2016 · 4 comments
Open

OPTIONS on /auth returns with 401 #194

gnunicorn opened this issue Jul 18, 2016 · 4 comments

Comments

@gnunicorn
Copy link
Contributor

Hey,

as the author of ghost in the safe I was trying to update my code yesterday to work with the latest launchers and on the test network. Unfortunately it won't let me log in.

I've patched the internal safenet javascript wrapper I am using to point to the right URL (api.safenet rather than localhost:8081), however it appears that the internally used fetch-API's first OPTIONS request onto /auth is denied and therefore everything dies:

screen shot 2016-07-18 at 10 04 15

Even though this is a "secretive" endpoint, I'd expect to receive a proper information response upon querying it with OPTIONS (something fetch internally always does and can't really prevented from doing, as it is required to work properly).

I suspect this regression might have been introduced with the update to the new 0.5 API.

@hitman401
Copy link
Contributor

hitman401 commented Jul 28, 2016

@ligthyear, sorry for getting to this after 10 days. My bad!

The proxy will filter the requests from non .safenet origin. In this case, origin in the request header is localhost:8080.
You can publish the files under the .safenet extension (just like we map a service) and work with your web app.

Can we close this issue, if you find it working based on the suggestion?

@gnunicorn
Copy link
Contributor Author

@krishnaIndia ah. that is good to know. Although, it does make local development much harder. While I suppose we could close this particular issue, I'd like to address how to make local development easy with it (maybe a switch in some extended settings? or a possibilities to configure it in a file?)

@gnunicorn
Copy link
Contributor Author

@krishnaIndia I tried updating the ghost in the safe for the alpha test net and got it to be "kinda" working (find it at http://app.ghost.safenet/ ), but there seems to be an issue with the new API. Unfortunately debugging directly on-net is kinda hard (can't just make changes). Do we have any update re: How to do a local development/debugging setup with the new CSP rules?

@hitman401
Copy link
Contributor

hitman401 commented Aug 14, 2016

@ligthyear, you can use the npm run start-dev command if you are compiling launcher on your machine.

If you are running, the binary then you can start in dev mode by passing the --proxy_unsafe_mode flag
example, safe_launcher --proxy_unsafe_mode

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants