René's URL Explorer Experiment


Title: canActivate=>false can result in blank screen/dead link · Issue #16211 · angular/angular · GitHub

Open Graph Title: canActivate=>false can result in blank screen/dead link · Issue #16211 · angular/angular

X Title: canActivate=>false can result in blank screen/dead link · Issue #16211 · angular/angular

Description: I'm submitting a ... (check one with "x") [ X ] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/...

Open Graph Description: I'm submitting a ... (check one with "x") [ X ] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not submit support reque...

X Description: I'm submitting a ... (check one with "x") [ X ] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not ...

Opengraph URL: https://github.com/angular/angular/issues/16211

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"canActivate=>false can result in blank screen/dead link","articleBody":"\u003c!--\nIF YOU DON'T FILL OUT THE FOLLOWING INFORMATION WE MIGHT CLOSE YOUR ISSUE WITHOUT INVESTIGATING\n-->\n\n**I'm submitting a ...**  (check one with \"x\")\n```\n[ X ] bug report => search github for a similar issue or PR before submitting\n[ ] feature request\n[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\n```\n\n**Current behavior**\n\u003c!-- Describe how the bug manifests. -->\ncanActivate, canActivateChild will result in NavigationCancel event if 'false'/reject() happens in the Guard. Additionally the URL is reset to the base path before the navigation attempt (as though to leave the user on the page they navigated from).\n\nThis current behavior means that if you just go directly to a location in your browser (e.g. localhost:4200/some-guarded-route) and it returns false the URL will read \"localhost:4200/\" with a blank page as navigation is canceled.\n\n**Expected behavior**\n\u003c!-- Describe what the behavior would be without the bug. -->\nThe right behavior to me seems that the router should try to see if there are further matches in the routing table (i.e. the guard 'false' case would cover the use case scenario of #14515). By continuing down the route table the behavior would be to land on '**' route in the worst case while also enabling conditional routing.\n\nMinimally NavigationCancel event should determine if the resetUrlToCurrentUrlTree is an already displayed route (either rendering it if necessary or doing nothing if it's already rendered).\n\nI will see if I can issue a PR to fix this for review. Will need to determine what the side effects would be for cases where people would expect just to stay on the currently rendered page (considering it was already rendered). However, to me I think the correct behavior for a dead link should be to go down the route table and hit '**' for a 404 or something vs doing nothing when the user clicks on it and rendering nothing if the user hits the route directly before any route has been rendered.\n\n**Minimal reproduction of the problem with instructions**\n\u003c!--\nIf the current behavior is a bug or you can illustrate your feature request better with an example, \nplease provide the *STEPS TO REPRODUCE* and if possible a *MINIMAL DEMO* of the problem via\nhttps://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5).\n-->\n\nPlunker won't work for this because you would need to be able to hit the route as though it was bookmarked to reproduce.\n\nEffectively just create project using CLI, create a route guard, return false in the methods. Then attempt to hit the route directly without loading a root non-guarded route first.\n\n\n**What is the motivation / use case for changing the behavior?**\n\u003c!-- Describe the motivation or the concrete use case -->\n\nMotivation is that you won't have the user on a blank screen if they happen to hit a guarded route without meeting the conditions.\n\nSecond part is that by resolving these scenarios by continuing down the route table you would enable conditional routing for scenarios such as:\n\nCreating routes like:\nlocalhost:4200/:organization\nlocalhost:4200/:user\n\nIf the route guard found a valid organization it could allow the request to move forward vs user. This is all gravy. A start is to not give the user a blank page when resetting the route via resetUrlToCurrentUrlTree when the current Url wasn't rendered in the first place.\n\n**Please tell us about your environment:**\n\u003c!-- Operating system, IDE, package manager, HTTP server, ... -->\nMac OS Sierra (10.12.4), WebStorm, NPM, ng serve\n\n* **Angular version:** Angular 4.0.2\n\u003c!-- Check whether this is still an issue in the most recent Angular version -->\n\n\n* **Browser:** Chrome 57\n\u003c!-- All browsers where this could be reproduced -->\n\n \n* **Language:** TypeScript 2.2.2\n\n* **Node (for AoT issues):** `node --version` =   \nNode 7.9","author":{"url":"https://github.com/matthewerwin","@type":"Person","name":"matthewerwin"},"datePublished":"2017-04-20T19:21:40Z","url":"https://github.com/angular/angular/issues/16211"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:1c97a947-0ef7-916d-c7c6-0a2010c1f694
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8F30:2C4BED:80AAC6:A52971:6B00E7DA
html-safe-nonce960d69bd6ac31c8c94e21b168d3edd8ae39cd51612d84010709d9917995ad7e0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RjMwOjJDNEJFRDo4MEFBQzY6QTUyOTcxOjZCMDBFN0RBIiwidmlzaXRvcl9pZCI6IjM1MDQzOTA3NDM0NzUxNTI4NTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac1d1513b18faac6470533380b1ce1f387c30bb8f49bad81c881a239106936dbed
hovercard-subject-tagissue:223171991
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/16211/issue_layout
twitter:imagehttps://opengraph.githubassets.com/32cd3a4e12f335b6f2154e023fe58b40f1b16d69c9117dff11b86268c5a4f61e/angular/angular/issues/16211
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/32cd3a4e12f335b6f2154e023fe58b40f1b16d69c9117dff11b86268c5a4f61e/angular/angular/issues/16211
og:image:altI'm submitting a ... (check one with "x") [ X ] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not submit support reque...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamematthewerwin
hostnamegithub.com
expected-hostnamegithub.com
None27088b6977484d0d3321d9a11c907c6d6637b315cfa359ef7952dbf6292f9b14
turbo-cache-controlno-preview
go-importgithub.com/angular/angular git https://github.com/angular/angular.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id24195339
octolytics-dimension-repository_nwoangular/angular
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24195339
octolytics-dimension-repository_network_root_nwoangular/angular
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release624179fb8b88d26ba5bba08894eb60a1c5a1d93d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/16211#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F16211
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F16211
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular
Reloadhttps://github.com/angular/angular/issues/16211
Reloadhttps://github.com/angular/angular/issues/16211
Reloadhttps://github.com/angular/angular/issues/16211
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues835 (835)https://github.com/angular/angular/issues
Pull requests140 (140)https://github.com/angular/angular/pulls
Discussionshttps://github.com/angular/angular/discussions
Actionshttps://github.com/angular/angular/actions
Projectshttps://github.com/angular/angular/projects
Security and quality40 (40)https://github.com/angular/angular/security
Insightshttps://github.com/angular/angular/insights
https://github.com/angular/angular
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/16211
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/16211
canActivate=>false can result in blank screen/dead linkhttps://github.com/angular/angular/issues/16211#top
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgenthttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22P3%22
area: routerhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20router%22
freq3: highhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22freq3%3A%20high%22
state: confirmedhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20confirmed%22
state: has PRhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20has%20PR%22
type: bug/fixhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
Backloghttps://github.com/angular/angular/milestone/82
https://github.com/matthewerwin
matthewerwinhttps://github.com/matthewerwin
on Apr 20, 2017https://github.com/angular/angular/issues/16211#issue-223171991
#14515https://github.com/angular/angular/issues/14515
Nexthttps://github.com/angular/angular/issues/16211?timeline_page=1
chuckjazhttps://github.com/chuckjaz
area: routerhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20router%22
on Apr 21, 2017https://github.com/angular/angular/issues/16211#event-1051577753
https://github.com/gedclack
gedclackhttps://github.com/gedclack
on Apr 24, 2017https://github.com/angular/angular/issues/16211#issuecomment-296526518
https://github.com/xdom
xdomhttps://github.com/xdom
on Jun 6, 2017https://github.com/angular/angular/issues/16211#issuecomment-306550251
@matthewerwinhttps://github.com/matthewerwin
https://github.com/matthewerwin
matthewerwinhttps://github.com/matthewerwin
on Jun 6, 2017https://github.com/angular/angular/issues/16211#issuecomment-306634257
#14515https://github.com/angular/angular/issues/14515
https://github.com/andrui
andruihttps://github.com/andrui
on Sep 20, 2017https://github.com/angular/angular/issues/16211#issuecomment-330788021
#18975https://github.com/angular/angular/issues/18975
https://github.com/code-tree
code-treehttps://github.com/code-tree
on Oct 5, 2017https://github.com/angular/angular/issues/16211#issuecomment-334348548
https://github.com/code-tree
code-treehttps://github.com/code-tree
on Oct 5, 2017https://github.com/angular/angular/issues/16211#issuecomment-334352319
https://github.com/AngularTx
AngularTxhttps://github.com/AngularTx
on Oct 10, 2017https://github.com/angular/angular/issues/16211#issuecomment-335528735
http://localhost:1000/a1http://localhost:1000/a1
http://localhost:1000/a1(withhttp://localhost:1000/a1(with
https://github.com/montella1507
montella1507https://github.com/montella1507
on Oct 10, 2017https://github.com/angular/angular/issues/16211#issuecomment-335530489
https://github.com/AngularTx
AngularTxhttps://github.com/AngularTx
on Oct 11, 2017https://github.com/angular/angular/issues/16211#issuecomment-335929906
https://github.com/matthewerwin
matthewerwinhttps://github.com/matthewerwin
on Oct 11, 2017https://github.com/angular/angular/issues/16211#issuecomment-335938638
@jasonadenhttps://github.com/jasonaden
https://github.com/AngularTx
AngularTxhttps://github.com/AngularTx
on Oct 16, 2017https://github.com/angular/angular/issues/16211#issuecomment-336816771
https://github.com/Goodwine
Goodwinehttps://github.com/Goodwine
on Nov 30, 2017https://github.com/angular/angular/issues/16211#issuecomment-348056026
https://github.com/matthewerwin
matthewerwinhttps://github.com/matthewerwin
on Nov 30, 2017https://github.com/angular/angular/issues/16211#issuecomment-348059259
@Goodwinehttps://github.com/Goodwine
https://myget.org/F/snaptech/npmhttps://myget.org/F/snaptech/npm
https://github.com/matthewerwin
matthewerwinhttps://github.com/matthewerwin
on Nov 30, 2017https://github.com/angular/angular/issues/16211#issuecomment-348060182
@Goodwinehttps://github.com/Goodwine
atscotthttps://github.com/atscott
on Jun 10, 2022https://github.com/angular/angular/issues/16211#event-6789231778
feat(router): Add CanMatch guard to control whether a Route should matchhttps://github.com/atscott/angular/commit/a99727f57c560868de06522de932ca1b309aeb1f
a99727fhttps://github.com/atscott/angular/commit/a99727f57c560868de06522de932ca1b309aeb1f
jessicajaniukhttps://github.com/jessicajaniuk
on Jun 13, 2022https://github.com/angular/angular/issues/16211#event-6799794793
feat(router): Add CanMatch guard to control whether a Route should ma…https://github.com/angular/angular/commit/de058bba9979f68de2320118b537e6be4dbb888d
de058bbhttps://github.com/angular/angular/commit/de058bba9979f68de2320118b537e6be4dbb888d
https://github.com/tharindu-nilakshana
tharindu-nilakshanahttps://github.com/tharindu-nilakshana
on Jun 23, 2022https://github.com/angular/angular/issues/16211#issuecomment-1163976351
https://github.com/atscott
atscotthttps://github.com/atscott
on Nov 20, 2026https://github.com/angular/angular/issues/16211#issuecomment-7029161353
atscotthttps://github.com/atscott
completedhttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Nov 20, 2026https://github.com/angular/angular/issues/16211#event-36727270195
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/16211
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/16211
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgenthttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22P3%22
area: routerhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20router%22
freq3: highhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22freq3%3A%20high%22
state: confirmedhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20confirmed%22
state: has PRhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20has%20PR%22
type: bug/fixhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
BacklogNo due datehttps://github.com/angular/angular/milestone/82
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.