How to get tenant in LiveView after setting it using `PlugHelpers.set_tenant`
I'm currently setting my tenant in my controller like this:
And this is how I put it in my LiveView socket assigns:
I am however getting warnings in my logs saying I should use
So I updated how I set the tenant:
This then sets the tenant in the private fields as per the docs.
But how do i get that tenant_id in my liveview? Its not stored in the session and I dont have access to the connection.
And this is how I put it in my LiveView socket assigns:
I am however getting warnings in my logs saying I should use
set_tenant:So I updated how I set the tenant:
This then sets the tenant in the private fields as per the docs.
But how do i get that tenant_id in my liveview? Its not stored in the session and I dont have access to the connection.
Solution
ok I think we are going in the right direction, so the authcontroller code is called when you sign in, but then it redirects and there you get a new conn and the browser pipeline only loads the user from the session. You need another plug/controller that you put after load_from_session, where you put this code
