We've moved discussions to Discord

Multitenancy in Jumpstart Pro: Additional user model belonging to tenant account

Rafik Mrabet
I have created a devise user model called Customer that belongs to a tenant account. To sign up a new customer of an account, I needed to add "authentication_keys: [:email, :account_id]" in the model class in customer.rb. This worked perfectly fine, leveraging the account_middleware.rb setup, which loads the account_id with every request.
However, for the sing in flow, things didn't work as the account_id doesn't make it to the POST request of the sessions create action.
Does anyone know how to make this work or how can i access the current_account within the devise sessions controller?
thanks!
Chris Oliver
You'll need to set the account somehow before you use a tenant model. That depends entirely on how you want your app to work.

Maybe only allow Customer sign in and registration on a subdomain?
Notifications
You’re not receiving notifications from this thread.