【发布时间】:2017-10-08 23:00:29
【问题描述】:
我正在尝试使用
获取用户令牌import { auth, database } from "firebase";
await token = await auth().currentUser.getIdToken();
但是,我收到了这个错误,
TypeError: Cannot read property 'getIdToken' of null
它有时有效,但有时无效。我在这里做错了什么?
【问题讨论】:
-
@NovoLucas 这对我没有帮助,我将 user 设为 null。
标签: firebase ecmascript-6 firebase-authentication