Reputation: 3368
I work with restful_authentication on my website. Here's my problem:
If I am not logged in and go the page http://mywebsite.com/something#coolHash
I get redirected to http://mywebsite.com/session/new and I log in.
But after that I get redirected to http://mywebsite.com/something but without the Hash which would be very important.
Is there a possibility to solve this?
Upvotes: 0
Views: 44
Reputation: 32933
I don't think you can do this as part of restful_authentication's regular url-forwarding system, because the browser strips off the part after the # before sending the request to the server. So, if the server never sees #coolHash then it can't save it into the session and retrieve it later on, after the user logs in. This would be a problem whatever server-based authentication you were using since the server never sees #coolHash (have a look in your access logs to see what request urls are actually recieved to verify this).
You could potentially solve the problem with javascript, i'm not sure what the nicest way would be. But, my advice would be to change your approach so that you don't care if #coolHash is remembered or not (any after-the-hash stuff should just be an enhancement to basically-works-fine behaviour anyway). For example, use a param instead of putting stuff after the hash. The param will be stored automatically by restful authentication.
Upvotes: 1