I'm trying to implement a custom elevator for apartment based on user login on a per request basis.
Basically what I'm trying to achieve is:
- Every time a request comes in, switch to the correct tenant
- If there's no logged user, the default tenant is select
However, my problem is that I don't how to retrieve the current user from the request(Rack::Request) object provided by the Generic Elevator. Any tips on how to do it or there's any other way to get the current user without the request?
I'm using devise for authentication.