-
Notifications
You must be signed in to change notification settings - Fork 4
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
should handle hash bang style urls #124
Comments
wasn't fixed. Didn't properly update the iframe url |
It still doesn't work @MAX-786 If I navigate inside the iframe I end up with a url like <iframe id="previewIframe" title="Preview" src="https://localhost:5173/?access_token=...4&_edit=false#/!/testpage-tram"></iframe> If I refresh the editor then I get a url like
If I navigate using contents then I end up with a url like <iframe id="previewIframe" title="Preview" src="https://localhost:5173/testpage-tram?access_token=...&_edit=false#/!"></iframe> All of which are wrong. Note you can't just test using the local npm run start and seeing if the page comes up because that vite server accepts both /path and /#/!/path type urls but some deployments like I've done with netlify are only going to support urls that don't set a url path. |
It also seems to have broken navigation in your frontend also. Not sure how. |
ok. I think I've fixed up changing the hash path and it routing to the right page. in my branch @MAX-786 |
Again vercel deployment issue Idk why it was pointing this url to 'main' branch deployment of my frontend which i use for testing and i have to manually change its settings after every commit so this url points to 'production' branch deployment... One more issue i just saw is that, inside frontend if you try TLDR;
So the solution of this is that hydrajs should just save the token in cookie at frontend domain (whenever it receives it from url ) and provide it to frontend. This is already done by hydrajs but just needed bit of tweaking bcz of this issue. |
@MAX-786 I deployed the fixes to my frontend to handle #! url changes properly. So now you can fix it so these urls work. The auth thing I don't completly understand. but it seems you are suggesting to not use args to indicate that you are in an edit state and instead use hydra.js api. however that means hydra.js needs to be loaded all the time which we discussed is not a something we want to require. I haven't seen a problem where the frontend forgets its logged in while editing so I'm not exactly sure what problem you are trying to fix or how to reproduce it My understanding is that if hydra navigates then its adding the auth token to the url. if the frontend navigates then its normally doing so keeping the page still loaded and so keeps its state. If it doesn't then it's probably up to the frontend to set it's own cookie? |
No no i mean that hydrajs once loaded it should save the essential stuff like token in cookie (with expiry) so next time when user changes the page and if it doesnt find auth token on url it can extract from cookies |
yes I understood that part but I'm still not sure what problem that solves. if the frontend is reloaded then it will be done by the AdminUI so the auth token will be put the url wouldn't it? |
is there a specific scenario where you are seeing reloading happening such that the auth token is no available? |
trying to replicate the issue but i think it is just on NEXTjs bcz it rarely happens, like assume you are on a path |
fixed by #126 |
@MAX-786 this is still not fixed. it is still not appending the path the end of the url |
The problem is I did tried to make this work in other ways like taking the hash or whatever is passed on while typing in URL and then doing something like : One obvious solution is to make vercel deployment also support like But to remove this limitation of having this type of routing supported by the frontend, we can do this is that have a way to tell adminUI that I am gonna use hash type of routing so append the path after this prefix and add params before this and so adminUI will remember this for particular frontends and thus do the routing and adding params normally for others. |
I think one quick solution would be to have f7 vercel deployment supports custom paths |
https://en.m.wikipedia.org/wiki/URI_fragment So what that means is you parse the base url. And if there is a fragment present then put the path in the fragment and add that at the end by using the URL API to construct a new url. Since #! Always seems to at least have the ! In it then this should work. If that doesn't work then we can use a replacement text but I don't think this will be needed. Since you are reconstructing the url then if the user puts in any search Params of their own then you should probably include them in addition to the ones we are adding. Not useful for this use case though. |
was fixed |
e.g. https://hydra-vue-f7.netlify.app/#/!/test
Makes it easy to deploy to some services with some frameworks
I don't know if there other schemes that would require further changes to the path but perhaps just treating it like a prefix and appending the path is ok?
e..g entering either https://hydra-vue-f7.netlify.app/#/!/ or https://hydra-vue-f7.netlify.app/#/! as the prefix should work
The Ui should explain its a prefix and any path will be appended to it
The text was updated successfully, but these errors were encountered: