0
我进口AngularFireAuth
要登出火力地堡中Angular4
import { AngularFireAuth } from 'angularfire2/auth';
并注射到我的服务consructor public afAuth: AngularFireAuth
,然后创建方法logut()
logut(){
return this.afAuth.auth.signOut()
.then(function() {
console.log("sign out");
}).catch(function(error) {
console.log("error sign out")
// An error happened.
});
}
当我调用我的logut方法控制台返回我sign out
,但我没有看到任何服务器的请求。 colud是一个问题?
* firebaser here *这是正确的答案。但是我们考虑在某些时候增加一个对服务器的调用以获得额外的安全性,这就是为什么'signOut()'已经返回一个promise。 –