-
Notifications
You must be signed in to change notification settings - Fork 189
Login occasionally redirects to the wrong path at random? #146
Comments
Perhaps even stranger, sometimes I don't even see the redirect to |
It seems the rubygems version is out of date. The latest version on master seems to resolve this issue for me! |
I am experiencing the same issue. Following @nozpheratu solution I set in my Gemfile:
also I set:
just to be safe. Still my requests are as follows: I want to visit a site in my application which requires me to log in. This log in redirects me to the CASino Application:
Now I enter my credentials and submit:
Because of the For me this happens probably ~60-70 % of the time. Anybody knows a solution for this? |
@bakku Yeah, that definietly sounds like the issue I was running into. I'm not entirely sure how bundler determines whether or not a gem is up-to-date, but I believe both the rubygems version of CASino and the Github version both resolve to v4.0.2 (despite 5 months of development between now & the last version bump!). You might have to manually run I believe you'll also need to re-run the rake task as well as |
@nozpheratu Thank you for your response. I tried out setting In the past I made two observations (I don't know of how much value they are):
|
@pencil I found the piece of code causing this problem. I looked up the commit history and saw that you commited this script initially (eventhough it was in 2012) In CASino the file
I don't really know when and why this line gets executed but I think the "random" effect of this problem has to do with the How can this be fixed? |
Currently don't have the time to look into this but you should check |
@pencil I don't really think that this is the problem, since there can hardly be an error in this piece of code, only if the root_path of CASino would be wrong in my application.
I rather think that the problem lies in If a user has two browsers with the CASino Application open and he logs in, in one window then it works how it should and the second window will log in aswell. The problem is the following: The user gets redirected to Moreover CASino sends a logout POST request to the applications telling them that a new user logged in. So at the moment in my application the user gets logged in twice in a very short and unnoticable time. But one (of all if there are more) sideeffect is that the saved url on the other application gets lost and the user is just redirected to the root path (if root path is the default url which a user gets redirected to after logging in as in devise). The two ways I tried out to try to keep
Maybe there are other possibilies but as long as there are not, in my view the benefit of having this functionality is not worth the double login it can produce. Until there is no other solution I will fork this project and take out How should we procede? |
I also have this problem. How did you solve it? If I remove sessions.js it stills redirects to the wrong url sometimes. |
Deleting sessions.js was enough in my case. If this does not work in your case then first try out if it works 100% of the time with Javascript disabled in the browser. Note that you might have to try it MANY times. Since the problem in the JavaScript was a timing problem. |
@ebarra are you using the absolute latest sorce code? See my comment abovem |
I am trying with the latest source code (but I have a problem that I have opened in another issue). |
Hello: And also deleted sessions.js file Any other idea? |
You can test by using my fork at https://github.com/bakku/CASino instead of the official CASino version to try out if you have the same problem as me or if it is something else. |
I changed to your fork and it still happens. |
try to disable javascript in the browser. if it still occurs then the problem lies elsewhere |
Without javascript the error disappears. I have logged-in and out like 30 times and all of them worked. |
Hello: |
This thread has already 18 comments and three people reported the same issue. |
Can somebody please post steps to reproduce, expected result, and actual result? |
In my application where the redirect was slow it happened ~70% of the time. I already posted detailed description of what I tracked as the problem above and how I solved it. |
I also encoutered this bug too. |
#162 I propose an new corrected session.js (instead of deleting it). Hope it will work for you |
Should theoretically work. I hope your pull request will get merged so I can change to the official version again |
My code is a little buggy. we need to move inside (after checkCookieExists();) } For one week now, i don't have redirect problems anymore. L. |
So I find myself running into this issue again almost a year later. It's definitely something in the |
I'm running into a strange bug that seems to appear seemingly at random. I have rack setup to pass requests on the '/authenticate' subdirectory to my Casino application:
I also inform rails that all routes need to include the '/authenticate' subpath:
More often than not, everything works great with this setup. However, if I try repeatedly logging out and logging back in, on the very rare occasion CASino will try to redirect to
login
without the subpath after it makes a request toproxyValidate
, as seen with my server logs:And on the remote rails app service using ActiveAdmin:
I can't for the life of me figure out where that redirect to
/login
is coming from. Again, I see this completely at random after logging in and logging out consecutive times.http://localhost:3000/admin
is the path where the browser should have been redirected to, but that seems to get overridden by CASino's redirect tohttp://localtoast:3001/login
(and no, "localtoast" is not a typo 😄).The text was updated successfully, but these errors were encountered: