javascript - 如何使用 Firebase Auth 强制退出用户?
问题描述
我正在尝试使用使用 firebase 构建的 Firebase Auth 退出应用程序。这实际上将用户注销,但它无法渲染新页面并给我:
TypeError: Cannot read property 'push' of undefined
这是我的代码:
// sign out
const signOut = (history ) => {
doSignOut().then(() => {props.history.push(routes.SIGN_IN)})
}
//
firestore.collection('customers').doc(userID).collection('subscriptions')
.where('status', '==', 'trialing' || "active").get()
.then(activeSubscriptions => {
// if this is true, the user has no active subscription.
if (activeSubscriptions.empty === false) {
console.log("line 31")
{signOut(props.history)}
}
});
有任何想法吗?
解决方案
推荐阅读
- powershell - 在for循环中循环多个变量
- javascript - ASP.NET MVC 控制器在返回响应之前等待模型
- puppet - 在 Puppet 中循环多个变量
- angular - Angular6 提交表单的 iframe
- linux - Python - 处理图像时 Spyder 上的 CV2 奇怪行为
- ember.js - 什么是灰烬金属?
- php - Angular 6 和 PHP:无法通过 HttpParams 向 PHP 脚本发送参数
- python - Pandas:根据与值对应的行数将列中的值替换为“其他”
- jquery - Jquery catcomplete搜索不起作用
- uber-api - uber_rides.errors.UberIllegalState:错误请求。缺少状态参数