How do I set current_user in middleware?

Viewed 2856

To give more background to my question, please refer to this Github issue - https://github.com/getsentry/raven-ruby/issues/144

I am using raven which is an error logger. I want to add the id for the current_user if user is logged in. The answer I received was

This should be done via your middleware or somewhere similar.

where this means setting the current_user in Raven.

I have read about middlewares, but still have not been able to figure out how can I get current_user in one.

2 Answers
Related