Closed
Description
Version info
Angular: 9-rc14
Firebase: 7.8.0
AngularFire: 6.0.0-rc0
Other (e.g. Ionic/Cordova, Node, browser, operating system):
How to reproduce these conditions
Failing test unit, Plunkr, or JSFiddle demonstrating the problem
Steps to set up and reproduce
Sample data and security rules
<-- include/attach/link to some json sample data (or provide credentials to a sanitized, test Firebase project) -->
Debug output
** Errors in the JavaScript console **
** Output from firebase.database().enableLogging(true);
**
** Screenshots **
Expected behavior
canActivate works
Actual behavior
canActivate doesn't work
canActivate(
next: ActivatedRouteSnapshot,
state: RouterStateSnapshot): Observable<boolean> | Promise<boolean> | boolean {
if (this.authenticationService.authenticated()) {
return true;
}
return this.authenticationService.user.pipe(take(1)).pipe(map(user => !!user)).pipe(tap(loggedIn => {
if (!loggedIn) {
this.logger.warn(`Access denied`);
this.snackBar.open('Access denied', null, {
duration: 2000,
});
this.router.navigate(['/login']);
}
}))
}
The above used to work.
Currently with 6.0.0-rc0 the above doesn't work
Returning true
or an observable does not allow the route to work
Metadata
Metadata
Assignees
Labels
No labels