【发布时间】:2016-08-07 17:02:35
【问题描述】:
我正在尝试在 Node.js 上使用 Auth.verifyIdToken 来验证服务器上的用户。但是,promise 拒绝并返回错误 TypeError: Cannot read property 'time' of undefined。是什么导致了这个错误?
【问题讨论】:
标签: firebase firebase-authentication
我正在尝试在 Node.js 上使用 Auth.verifyIdToken 来验证服务器上的用户。但是,promise 拒绝并返回错误 TypeError: Cannot read property 'time' of undefined。是什么导致了这个错误?
【问题讨论】:
标签: firebase firebase-authentication
TypeError: Cannot read property 'time' of undefined 错误来自我在 Auth.verifyIdToken 返回的 promise 的 then 函数中的代码。这个错误使 promise 的 catch 函数运行。 Auth.verifyIdToken 方法本身没有错误。
要仅捕获来自 Auth.verifyIdToken 的错误,请在 then 中的代码之前调用 catch。
【讨论】: