-
Notifications
You must be signed in to change notification settings - Fork 1.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
Re-written URL with token does not work with Angular default routing #599
Comments
I've bumped on the same issue. Workaround is to use pretty urls in Angular. EDIT: Seen Your comment about HTML5. You're right. This issue should be patched. Old way worked like a charm. |
@rachuxx feel free to submit a PR! Closing for now due to a proposed workaround. |
Unfortunately we do depend upon the old URL-Schema of Angular. We can't just change to HTML5 Routes, so this Workaround does not apply. Pls reopen. |
Hi @array42 , I'm glad to reopen if you submit a pull request for your problem. |
Thank's for the offer. As a new kind of workaround we introduced a extra route and we rewrite the URL there. So that way we did not have to change this library code, but it is another route and redirect. |
We are using devise-token-auth with ng-token auth, and we have set a custom URL for the password reset:
The way devise-token-auth breaks apart and re-builds the URL to include the token during the password reset process causes our Angular app to show a weird URL once a person is logged in after resetting the password. The Angular fragment identifier is at the end, after the token in the query string.
For example,
The current code that does it this way is at https://github.com/lynndylanhurley/devise_token_auth/blob/15bf7857eca2d33602c7a9cb9d08db8a160f8ab8/lib/devise_token_auth/url.rb
It looks like it was changed at one point to work with Angular routing, b367d67, but then it was changed to the current form later because of an iOS issue, #213
I know that the current form adheres to the HTML spec. I also know that switching to the HTML5 routing in Angular effectively circumvents this issue, because we have another Angular app with a similar setup which uses HTML5 routing, and that works as expected. However, we are not able to switch the first app to HTML5 routing for other reasons.
Both apps use the same Rails API, and as a workaround we have overridden the devise-token-auth's password controller edit method, to sniff out URLs with fragment at the end, and rewrite them the old way. This is hacky, though.
It looks like this issue has come up before, #321, but it seems that the reporter in that case decided to solve it by not overriding the password reset URL.
Is there a possibility that the library could be made rewrite the URLs based on whether it needed iOS or Angular style?
The text was updated successfully, but these errors were encountered: