【发布时间】:2017-08-14 06:14:37
【问题描述】:
我使用 Firebase 和 Swift 对 Instagram 进行自定义身份验证。
我现在有这个问题,Remove a user through dashboard, but the user is still logged in?
当我启动应用程序时,我有这个监听器:
Auth.auth().addStateDidChangeListener {
我在其中设置了一个观察者:
ref.child("users/\(user.uid)").observe(.value, with: { (snapshot) in
print(snapshot)
..........
}, withCancel: { error in
print(error)
})
with 和 withCancel 处理程序不会执行,因为用户的令牌不再存在。 (非常奇怪的 IMO,甚至 withCancel 也不会执行)。
我必须在代码中捕捉到这种情况,才能强制注销,如帖子所述:
检查您是否可以读取到您的用户区,如果那里没有任何内容,请强制注销。
【问题讨论】:
标签: swift authentication firebase