Title: canActivate is broken on 6.0.0 · Issue #2312 · angular/angularfire · GitHub
Open Graph Title: canActivate is broken on 6.0.0 · Issue #2312 · angular/angularfire
X Title: canActivate is broken on 6.0.0 · Issue #2312 · angular/angularfire
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 ...
Open Graph 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 JSFi...
X 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 JSFi...
Opengraph URL: https://github.com/angular/angularfire/issues/2312
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"canActivate is broken on 6.0.0","articleBody":"\u003c!--\r\n\r\nIMPORTANT! YOU MUST FOLLOW THESE INSTRUCTIONS OR YOUR ISSUE WILL BE CLOSED.\r\n\r\nThank you for contributing to the Angular and Firebase communities!\r\n\r\nHave a usage question?\r\n=======================\r\nWe get lots of those and we love helping you, but GitHub is not the best place for them and they will be closed. Here are some resources to get help:\r\n\r\n- Go through the Developer's Guide: https://github.com/angular/angularfire2#developer-guide\r\n\r\nIf the official documentation doesn't help, try asking through our officially supported channels:\r\n\r\n- Firebase Google Group: https://groups.google.com/forum/#!forum/firebase-talk\r\n- Stack Overflow: https://stackoverflow.com/questions/tagged/angular (include the firebase and angularfire tags, too!)\r\n\r\n*Please avoid double posting across multiple channels!*\r\n\r\nThink you found a bug?\r\n=======================\r\nYeah, we're definitely not perfect! Please use the bug report template below and include a minimal repro when opening the issue.\r\n\r\nHave a feature request?\r\n========================\r\nGreat, we love hearing how we can improve our products! Remove the template below and\r\nprovide an explanation of your feature request. Provide code samples if applicable. Try to\r\nthink about what it will allow you to do that you can't do today? How will it make current\r\nworkarounds straightforward? What potential bugs and edge cases does it help to avoid?\r\n\r\n--\u003e\r\n\r\n\r\n### Version info\r\n\r\n\u003c!-- What versions of the following libraries are you using? Note that your issue may already\r\nbe fixed in the latest versions. --\u003e\r\n\r\n**Angular:** 9-rc14\r\n\r\n**Firebase:** 7.8.0\r\n\r\n**AngularFire:** 6.0.0-rc0\r\n\r\n**Other (e.g. Ionic/Cordova, Node, browser, operating system):**\r\n\r\n### How to reproduce these conditions\r\n\r\n**Failing test unit, Plunkr, or JSFiddle demonstrating the problem**\r\n\r\n\u003c!-- \r\nProvide a failing test unit, or create a minimal, complete, and \r\nverifiable example (http://stackoverflow.com/help/mcve) using either \r\nPlunker (http://plnkr.co/) or JSFiddle (https://jsfiddle.net/).\r\n--\u003e\r\n\r\n**Steps to set up and reproduce**\r\n\r\n\u003c!-- detailed instructions to run your minimal repro or to recreate the environment --\u003e\r\n\r\n**Sample data and security rules**\r\n\r\n\u003c-- include/attach/link to some json sample data (or provide credentials to a sanitized, test Firebase project) --\u003e\r\n\r\n### Debug output\r\n\r\n** Errors in the JavaScript console **\r\n\r\n** Output from `firebase.database().enableLogging(true);` **\r\n\r\n** Screenshots **\r\n\r\n### Expected behavior\r\n\r\ncanActivate works\r\n\r\n### Actual behavior\r\n\r\ncanActivate doesn't work \r\n\r\n\r\n```\r\ncanActivate(\r\n next: ActivatedRouteSnapshot,\r\n state: RouterStateSnapshot): Observable\u003cboolean\u003e | Promise\u003cboolean\u003e | boolean {\r\n if (this.authenticationService.authenticated()) {\r\n return true;\r\n }\r\n\r\n return this.authenticationService.user.pipe(take(1)).pipe(map(user =\u003e !!user)).pipe(tap(loggedIn =\u003e {\r\n if (!loggedIn) {\r\n this.logger.warn(`Access denied`);\r\n this.snackBar.open('Access denied', null, {\r\n duration: 2000,\r\n });\r\n this.router.navigate(['/login']);\r\n }\r\n }))\r\n\r\n }\r\n```\r\n\r\nThe above used to work. \r\n\r\nCurrently with 6.0.0-rc0 the above doesn't work \r\n\r\nReturning `true` or an observable does not allow the route to work \r\n","author":{"url":"https://github.com/jimmykane","@type":"Person","name":"jimmykane"},"datePublished":"2020-02-05T11:44:03.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":10},"url":"https://github.com/2312/angularfire/issues/2312"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ccb60022-6f6c-ac0b-5660-a91b8208bc77 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C8B0:30B305:1110BD1:16F88AD:6A5AAD4E |
| html-safe-nonce | 18bebdfd59446ff7c259ab23895588c2d1ec22470ee10a889fa199c8522c125a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOEIwOjMwQjMwNToxMTEwQkQxOjE2Rjg4QUQ6NkE1QUFENEUiLCJ2aXNpdG9yX2lkIjoiNDUzOTUyNTMyOTc3ODgxNDI4NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a7a4d6db5e0ee488a492621b6472ca7a3c657300e7daacf86b646cdaff9982db |
| hovercard-subject-tag | issue:560317999 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angularfire/2312/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4595356ae22ca9d9034810f9338b831585b870b809b85a35c103046b8a7d6a95/angular/angularfire/issues/2312 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4595356ae22ca9d9034810f9338b831585b870b809b85a35c103046b8a7d6a95/angular/angularfire/issues/2312 |
| og:image:alt | 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 JSFi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jimmykane |
| hostname | github.com |
| expected-hostname | github.com |
| None | 21c53da6db0c40484841ba32fe19ecf485e7e734334faab487cd59d884d2bb33 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angularfire git https://github.com/angular/angularfire.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 49453413 |
| octolytics-dimension-repository_nwo | angular/angularfire |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49453413 |
| octolytics-dimension-repository_network_root_nwo | angular/angularfire |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6e85f20f54e1147d8162094880590864abefff6b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width