Getting 404 when trying to authenticate sanity in gitpod

161 Views Asked by At

I am trying to use sanity in Gitpod.

When trying to use google authentication, it will be forwarded to http://localhost:4321/, but Gitpod doesn't recognise http://localhost:4321/. How can I solve this issue?

I think this issue related to port forwarding. but don't know how to fix it.

2

There are 2 best solutions below

0
axonasif On

You will need port forwarding from your local machine to have such localhost URLs work as expected. See the below link:

Additionally, if the CLI tool supports a no-browser or non-interactive mode through a flag, you could also use that.

0
Ifechukwu Asiadiachi On

The problem is sanity generates a url with the local host port meanwhile gitpod uses a custom port. You can solve this by copying the custom gitpod url and posting it just before the localhost. e.g

custom gitpod url: https://4321-if3er2-beekreedblog-pz46j6z86xu.ws-eu90.gitpod.io

http://{paste custom gitpod url here}/callback?sid=FiKHNh5ZN1CQpvNuqMucxvVxl9Oar6oZ&url=https%3A%%2Fapi.sanity.io%2Fv1%2Fauth%2Ffetch%3Fsid%3DFZ