You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current auth-guard provided with angular fire is still using the now deprecated class based approach and targets the canActivate property on route definitions.
To freshen things up a bit, I have generated a new guard which utilizes the new functional approach and targets the newer canMatch route definition property. This has the added benefit of preventing components from being unnecessarily loaded which seems to work well and should be more performant.
I based the new code off of the previous implementation documented here. You will notice similarities with the previous guard code here. Would love to see this incorporated into the AngularFire package but honestly I'm too lazy to write tests 😅 so if someone would be interested in owning that and collaborating, I'd be happy to open up a PR.
Feature Request - authCanMatchGuard + helpers
Description
The current auth-guard provided with angular fire is still using the now deprecated class based approach and targets the
canActivate
property on route definitions.To freshen things up a bit, I have generated a new guard which utilizes the new functional approach and targets the newer
canMatch
route definition property. This has the added benefit of preventing components from being unnecessarily loaded which seems to work well and should be more performant.I based the new code off of the previous implementation documented here. You will notice similarities with the previous guard code here. Would love to see this incorporated into the AngularFire package but honestly I'm too lazy to write tests 😅 so if someone would be interested in owning that and collaborating, I'd be happy to open up a PR.
Code
auth-can-match.guard.ts
The text was updated successfully, but these errors were encountered: