Title: child canActivate is called before parent canActivate is resolved when using AuthGuards · Issue #11161 · angular/angular · GitHub
Open Graph Title: child canActivate is called before parent canActivate is resolved when using AuthGuards · Issue #11161 · angular/angular
X Title: child canActivate is called before parent canActivate is resolved when using AuthGuards · Issue #11161 · angular/angular
Description: [x ] bug report => search github for a similar issue or PR before submitting Current behavior Child canActivate is called before parent canActivate is resolved. e.g // RouterConfig { path: 'parent', component: ParentComponent, canActivat...
Open Graph Description: [x ] bug report => search github for a similar issue or PR before submitting Current behavior Child canActivate is called before parent canActivate is resolved. e.g // RouterConfig { path: 'parent'...
X Description: [x ] bug report => search github for a similar issue or PR before submitting Current behavior Child canActivate is called before parent canActivate is resolved. e.g // RouterConfig { path: '...
Opengraph URL: https://github.com/angular/angular/issues/11161
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"child canActivate is called before parent canActivate is resolved when using AuthGuards","articleBody":"```\n[x ] bug report => search github for a similar issue or PR before submitting\n```\n\n**Current behavior**\nChild canActivate is called before parent canActivate is resolved. e.g\n\n```\n// RouterConfig\n{\n path: 'parent',\n component: ParentComponent,\n canActivate: [ParentAuthGuard],\n children: [\n defaultPath('child'),\n {\n path: 'child',\n component: ChildComponent,\n canActivate: [ChildAuthGuard],\n }\n ]\n},\n```\n\n```\n// Parent AuthGuard\ncanActivate(activatedRouteSnapshot: ActivatedRouteSnapshot) {\n console.log('Parent Auth Guard Called');\n return this.service.get().map((response) => {\n console.log('Parent AuthGuard Resolved');\n if (response) { return false; }\n return true;\n });\n}\n```\n\n```\n// Child AuthGuard\ncanActivate(activatedRouteSnapshot: ActivatedRouteSnapshot) {\n console.log('Child AuthGuard Called')\n if (someCondition) return true;\n return false;\n}\n```\n\nOutput\n1. Parent Auth Guard Called\n2. Child AuthGuard Called\n3. Parent AuthGuard Resolved\n\n**Expected/desired behavior**\nParent AuthGuard should be resolved before child AuthGuard is called\nOutput\n1. Parent Auth Guard Called\n2. Parent AuthGuard Resolved\n3. Child AuthGuard Called\n\n**What is the motivation / use case for changing the behavior?**\nIn my opinion shouldn't child canActivate hold until parent is resolved. What do you guys say and whats the motivation behind not waiting for parent to resolve.\n- **Angular version:** 2.0.0-rc.4\n- **Browser:** [all] \n- **Language:** [TypeScript | ES6/7] \n","author":{"url":"https://github.com/fouadbhatti","@type":"Person","name":"fouadbhatti"},"datePublished":"2016-08-30T10:09:14Z","url":"https://github.com/angular/angular/issues/11161"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:68d37e83-64c8-3306-dbe5-ffb94a443e09 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9DAA:2E7EBB:F83FF1:13A33EF:6B010BBB |
| html-safe-nonce | a3b874b5db82a20e7ba8347005627fd19cadfe890b47ae7b25fc5e7dd97c3ccb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5REFBOjJFN0VCQjpGODNGRjE6MTNBMzNFRjo2QjAxMEJCQiIsInZpc2l0b3JfaWQiOiI5MDgxODY4NzQ0NzQwODk5NzcxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 7635d11e98a93e54f3b4b03cb03e1d05e18406f9751f22a80462f1399293604f |
| hovercard-subject-tag | issue:173980107 |
| 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/angular/11161/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cfc88b638eb08ed377bb495be7bdb8d41c087db650bdfe36d89f0a5115b5f431/angular/angular/issues/11161 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cfc88b638eb08ed377bb495be7bdb8d41c087db650bdfe36d89f0a5115b5f431/angular/angular/issues/11161 |
| og:image:alt | [x ] bug report => search github for a similar issue or PR before submitting Current behavior Child canActivate is called before parent canActivate is resolved. e.g // RouterConfig { path: 'parent'... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | fouadbhatti |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| 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 | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width