【发布时间】:2021-05-24 16:03:56
【问题描述】:
我一直在研究 this code base 作为如何使用 Firebase 后端对我的项目实施 LinkedIn 授权的示例。我感到困惑的一件事是这些行:
var code = getURLParameter("code");
var state = getURLParameter("state");
var error = getURLParameter("error");
if (error) {
document.body.innerText = "Error back from the LinkedIn auth page: " + error;
} else if (!code) {
// Start the auth flow.
window.location.href = "/redirect";
}
window.location.href = '/redirect',我相信它是为了调用称为“重定向”的云功能。在我的代码库中,它只是去一个未知的路线并触发我的后备。我对这行代码的目的有误吗?有谁知道它没有触发云功能的任何可能原因(控制台说 0 次调用)?我应该查看哪些其他信息来尝试调试?
【问题讨论】:
-
您是否设置了 firebase.json 以将
/redirect路径指向函数? -
@imjared 我没有。非常感谢您指出这一点。这是否意味着 firebase 功能仅在托管在 firebase 上时才有效?
标签: firebase http firebase-authentication google-cloud-functions linkedin-api