question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

rc2 Router strips extra arguments from the path after matching a route

See original GitHub issue

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/angular/angular/blob/master/CONTRIBUTING.md#question

I am trying to implement OAuth2 implicit flow. It redirects to a specified url with a hash appended - #access_token. This is a problem with HashLocationStrategy because it looks for a matching route. As a workaround I just defined a route that redirects to the root.

{ path: 'access_token', redirectTo: '/' }

Current behavior In rc2 the router started to strip everything in the URL - for example the value of the access_token.

Expected/desired behavior In rc1 the router didn’t strip anything from the URL and all hashes remained untouched.

Reproduction of the problem If the current behavior is a bug or you can illustrate your feature request better with an example, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5).

What is the expected behavior?

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

  • Angular version: 2.0.0-rc.X
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
  • Language: [all | TypeScript X.X | ES6/7 | ES5]

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
zoechicommented, Sep 1, 2016

@vicb I also think that adding a config parameter to the route config is a valid feature request.

2reactions
akorchevcommented, Sep 1, 2016

I wonder why you think this is a support request. There isn’t a single question in this issue.

  1. Upgrading to angular router rc3 broke existing functionality (OAuth authorization).
  2. It turned out to be a fix that has a side effect.
  3. I don’t think there is any way now to implement OAuth implicit flow login with angular 2 if I use HashLocationStrategy. Of course I can use PathLocationStrategy but then a browser refresh breaks my app (nothing on the server side to handle the route).
Read more comments on GitHub >

github_iconTop Results From Across the Web

Router in axum::routing - Rust - Docs.rs
Nest a group of routes (or a Service ) at some path. This allows you to break your application into smaller pieces and...
Read more >
How to use the HashLocationStrategy with the Auth0 Lock ...
See RC2 Router strips extra arguments from the path after matching a route and navigation should not preserve query params and fragment for ......
Read more >
Router (jooby 2.16.1 API) - javadoc.io
Set application context path. Context path is the base path for all routes. Default is: / . Parameters: contextPath - Context path. Returns:...
Read more >
HTTP route components (proto) - Envoy Proxy
QueryParameterMatcher) Specifies a set of URL query parameters on which the route should match. The router will check the query string from the...
Read more >
_routing field | Elasticsearch Guide [8.5] | Elastic
Instead of having to fan out a search request to all the shards in an index, the request can be sent to just...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found