在使用firebase执行logout()之后在Ionic 3上工作时,重定向到登录页面后出现以下错误:
Error: Missing or insufficient permissions.
at new FirestoreError (error.js:140)
at JsonProtoSerializer.fromRpcStatus (serializer.js:93)
at JsonProtoSerializer.fromWatchChange (serializer.js:573)
at PersistentListenStream.onMessage (persistent_stream.js:393)
at persistent_stream.js:337
at PersistentListenStream.<anonymous> (persistent_stream.js:313)
at step (tslib.es6.js:97)
at Object.next (tslib.es6.js:78)
at tslib.es6.js:71
at new t (polyfills.js:3)
auth-provider的注销功能执行以下代码:
logout(): Promise<any> {
// TODO: Read from storage if user loggedIn via FB before the call.
return new Promise((resolve, reject) => {
this.angularFireAuth.auth.signOut().then(() => {
resolve();
}).catch(() => {
reject();
});
});
}
和组件中的调用者函数执行以下代码:
private logout(): void {
this.auth.logout().then(() => {
this.menuCtrl.close();
this.nav.setRoot('page-login');
});
}
显示登录页面后,立即出现错误。