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.

Wrong queryString when building navigation plan in aurelia-router

See original GitHub issue

I’m submitting a bug report

  • Library Version: 1.7.1

Please tell us about your environment:

  • Operating System: Windows 10

  • Node Version: 10.15.1

  • NPM Version: 6.4.1

  • JSPM OR Webpack AND Version webpack 4.29.6

  • Browser: all

  • Language: TypeScript

Current behavior: Not redirected with correct query parameter. We are using aurelia-open-id-connect and when redirected back from our identity provider the query parameters are removed when creating the redirectPlan in aurelia-router, navigation-plan.ts. In my example you can see that the path we’re navigating to is “/example?test=123”. But in the end the query string is removed because the wrong instruction is used when getting query params.

image

  • What is the expected behavior? Instead of getting queryString from instruction like this:
if (instruction.queryString) {
    redirectLocation += '?' + instruction.queryString;
}

I think you should get it from redirectInstruction like this:

if (redirectInstruction.queryString) {
    redirectLocation += '?' + newInstruction.queryString;
}

image

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
MartyBoicommented, Jun 17, 2019

@bigopon I think something like this should keep your existing tests intact and fix the issue I’m having. Could you please try this?

let queryString = instruction.queryString;
if (queryString) {
   redirectLocation += '?' + queryString;
}
let redirectQueryString = redirectInstruction.queryString;
if (redirectQueryString) {
   if (queryString) {
      redirectLocation += redirectQueryString;
   } else {
      redirectLocation += '?' + redirectQueryString;
   }
}
0reactions
rmjacommented, Feb 11, 2022

@davismj There are simple failing examples in #667 and #643 seems to solve the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Wrong queryString when building navigation ... - Stack Overflow
This is an issue with latest history-browser module, which is used by aurelia-router to handle the fragment. · @bigopon I'm using version 1.3....
Read more >
Return to route after login using navigation instruction
I'm trying to set up a failed-auth post-login redirect. My plan is (was) that when authentication fails, the intended (i.e. requiring auth) ...
Read more >
Top 18 Most Common AngularJS Developer Mistakes - Toptal
Sheer size of the AngularJS can easily lead to many mistakes. In this article you will learn about most common AngularJS developer mistakes...
Read more >
Aurelia Routing with a Parameter - Eric L. Anderson
Aurelia /detail', nav: false, title: 'Detail' } ]); this.router ... not have a in the route definition will be added to the query...
Read more >
Clustering 4000 Stack Overflow tags with BigQuery k-means
Now get ready for some SQL magic. BigQuery ML does a good job of hot-encoding strings, but it doesn't handle arrays as I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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