-
Notifications
You must be signed in to change notification settings - Fork 323
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
Access Rails session from Faraday middleware #15
Comments
Well that's actually a bit more complicated than I thought (since you can only interact with the
Hope that helps! |
I’m going to close this issue since it wasn’t active in the last month. Hopefully you found a solution that fit your needs! |
@remiprev, just a quick question about the solution you provided. Is that thread safe? if the class MyApp is long lived and someone else comes in and sets the current_user before the FaradayMiddleware has access to it.. wouldn't that be bad? I ask because I don't know. |
@incorvia I added a thread-safe example in |
Thank you @remiprev a very good example and a great resource for future use. |
The README file has the following comment:
Can you give me an example of how you could access the current Rails session from that code block? I've put the code in a Rails initialiser file.
Thanks
The text was updated successfully, but these errors were encountered: