-
Notifications
You must be signed in to change notification settings - Fork 204
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
User session lost after post request #132
Comments
I don't see anything immediately wrong. It sounds like your session is being rotated out from under you. Can you confirm the contents of your session are what you expect? |
As I understand it, the This is my test logic right now:
This results in the following output:
I can run however many |
Any news on this? |
@stephan-nordnes-eriksen I think we'd need a full test case to really dig in. My first guess is there is something going on with your test environment, but cannot know for sure without a sample project showing the error |
Has there been any activity on this? I'm seeing it also. I can authenticate, but as soon as I try to visit any other URL in the app, the user is nil. I have attached a demo project (as simple as I could keep it) that exhibits the behavior. |
@LarryFransson you mind tossing this zip into a github repo? I cant download a random zip file on my machine 🔐 |
Sure thing. Here you go: https://github.com/LarryFransson/demo |
@LarryFransson sounds good. I should have time later this week to take a look. |
Has there been any update on this ? Facing similar issues Update: I fixed this on my repo by serializing_from_session and into_session through warden |
Is it possible you have a domain set on your cookie that doesn't match what your test domain is running as? |
FTR I don't think this is a problem with Warden. I don't have a solution but I want to share a related story in case anyone else runs into things and finds this thread like we did. We have a react app sitting on top of a Grape API. The app works flawlessly almost everywhere except once place: when someone clicks a link to the app from a DM inside the Instagram mobile app, which is then opened in an instance of a iOS WKWebView. Even worse, the issue is not consistently repeatable. Close to 90% of the time there is no issue, but ~10% of the time users get half way into our onboarding flow and then get stuck with a 401 when trying to POST. The oddest thing. Part of our flow includes getting a code emailed to you, and the place where the auth goes haywire is always after someone switches out of the IG app and over to their mail client to get the code. I think IG might be doing something funky with how it instantiates it's WKWebView that is causing cookies to be cleared under some circumstances when going back into the app. |
It appears that my
env['warden'].user
is lost if my app receives a post request.This is the test methods I am using:
The
HTTP_COOKIE
is the same for both requests, but for some reason the warden user is lost when I send a post request. It is lost for that request and further all requests (including get requests).This is my a strategy:
This is my user model:
Is there something wrong with my strategy?
The text was updated successfully, but these errors were encountered: