You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[go_router] Access to fragment(/#access_token=bla_bla_bla) in router state #108614
I'm using Amazon Cognito auth and it sends token in redirect URL as /#access_token=bla_bla_bla
On v4.1 it worked well for me and I was able to access to this fragment in state.location.
On v4.2 there is no more fragment in state.location.
Proposal
Could you expose fragment(#access_token=bla_bla_bla) the same way as you do with state.params?
changed the title [-][go_router] Access to fragment(`/#access_token=bla_bla_bla`) in router state.[/-][+][go_router] Access to fragment(`/#access_token=bla_bla_bla`) in router `state`[/+]on Jul 29, 2022
yes this looks correct, although I am not the owner of that part of the code. feel free to open a pr and pin me on it, I can help redirect to the right person
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
[-][go_router] Access to fragment(`/#access_token=bla_bla_bla`) in router state.[/-][+][go_router] Access to fragment(`/#access_token=bla_bla_bla`) in router `state`[/+]chunhtai commentedon Aug 4, 2022
Is this a regression that it worked on 4.1?
also can you provide a minimum repro code?
vasilich6107 commentedon Aug 5, 2022
Ok, will prepare some code
chunhtai commentedon Aug 25, 2022
It looks like the fragment is dropped somewhere in the parsing pipeline
_addQueryParamsin match.dart should also append the fragment.SheriefAlaa commentedon Nov 6, 2022
I can reproduce on version 5.1.5. Flutter 3.3.5.
5 remaining items
vasilich6107 commentedon Jul 21, 2023
When you refresh the page - the fragment magically disappears
Screen.Recording.2023-07-21.at.10.46.11.mov
vasilich6107 commentedon Jul 21, 2023
Hi @chunhtai
It seems that this line
https://github.com/flutter/flutter/blob/master/packages/flutter_web_plugins/lib/src/navigation/url_strategy.dart#L57
misses
+ (_platformLocation.hash ?? '')This code works fine. Could you help me with clarification if this is an acceptable solution?
chunhtai commentedon Jul 21, 2023
yes this looks correct, although I am not the owner of that part of the code. feel free to open a pr and pin me on it, I can help redirect to the right person
vasilich6107 commentedon Jul 21, 2023
Sure, thanks a lot.
Will do the PR
vasilich6107 commentedon Jul 23, 2023
Possibly related issues
#126044
#122058
yjbanov commentedon Aug 3, 2023
Assigned to @vasilich6107 and @chunhtai who are actively working on the PR.
chunhtai commentedon Aug 3, 2023
should be fixed by #131123
Access to fragment in router state on page refresh (#131123)
Access to fragment in router state on page refresh (flutter#131123)
github-actions commentedon Dec 21, 2023
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.