-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hash mode places # at incorrect location in URL if current query parameters exist on page load #2125
Hash mode places # at incorrect location in URL if current query parameters exist on page load #2125
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Edited title to better reflect core issue. I don't believe vue-router should try to support detecting query params before |
Well, for starters, since you did not actually add the router to the app in I fixed this for you: https://codesandbox.io/s/5wpjknyy6x |
I'm also having this same issue when trying to use oauth with github. My callback url is set to |
…s#2125) When navigating to a URL with a query string like myapp.com?foo=bar in hash mode, the hash is currently placed after the query string myapp.com?foo=bar#/ This fix correctly parses URLs with query strings so that the above URL will be myapp.com/#/?foo=bar after loading.
Note that the workaround (see below) referenced in the other issue is unsatisfactory because
const query = (new URLSearchParams(window.location.search.substring(1)));
if (query.has('code') && query.has('state')) { |
Hey @posva, Is it possible to get a link to the PR I brief look at outstanding PR's and could not find it, or am I misunderstanding the tag? Cheers. |
@posva Maybe I am missing something, and I apologize if I am, but I forked @LinusBorg 's update to the sandbox, updated the versions of Vue to 2.6.11 and Vue-Router to 3.1.5 and also added a simple computed property that gets it's value from the query param and it still appears that the https://codesandbox.io/s/vue-template-fxmc1 Going to I would expect it should be |
Is there any news? |
Please see #2125 (comment) |
Version
3.0.1
Reproduction link
https://codesandbox.io/s/zlvz65rplp
Steps to reproduce
Navigate to myapp.com?foo=bar
What is expected?
Hash is appended before query parameters, to get the final result of myapp.com/#/?foo=bar
What is actually happening?
Hash is placed after parameters myapp.com?foo=bar#/ (also making the query parameters inaccessible with
this.$route.query
)Note on codesandbox link - unable to place query parameter for initial URL in editor preview - please remove
/#/
& append?foo=bar
Running across this in an instance where user authentication is done outside our app, but client/user identifier is passed to our app in query parameter upon authorization.
The text was updated successfully, but these errors were encountered: