0

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.

Ali
  • 31
  • 4

2 Answers2

0

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.

AXON
  • 183
  • 1
  • 5
0

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

avariant
  • 2,234
  • 5
  • 25
  • 33