来自客户端的firebase云功能调用将我重定向到account.google.com/ServiceLogin

时间:2020-03-20 09:41:05

标签: firebase google-cloud-functions firebase-hosting

当我调用Firebase Cloud函数https请求时,它将重定向到 account.google.com/ServiceLogin?service=ah&passive=true&continue={my-cloud-function-http-url}

这是我的firebase.json(托管配置)

...
"hosting": {
  "public": "client/dist",
  "ignore": [
    "firebase.json",
    "**/.*",
    "**/node_modules/**"
  ],
  "rewrites": [
    {
      "source": "/api/v1/**",
      "function": "midleman"
    },
    {
      "source": "**",
      "destination": "/index.html"
    }
  ],
  "trailingSlash": false
},
...

是Google Firebase的错误还是我错过了配置?

1 个答案:

答案 0 :(得分:0)

当您尝试访问的 URL 无法访问 (404 Not Found) 时,通常会发生这种情况。确保您在 HTTP 客户端中输入了正确的 URL,然后重试。

例如,您正在尝试访问 https://us-central1-[project_id].cloudfunctions.net/london 但您输入了 https://us-central1-[project_id].cloudfunctions.net/new-york。如果最新的不是有效的函数名称,您将被重定向到 Google 登录页面。