How to implement multi tenancy in user with unique email per site and global
Hi, sorry. I need to have an email global and email which is assigned to a site in my system
For example:
So i set
multitenancy
like this in my user resource
And the relationships in user
And the last part, I change the unique_email to this, the nils_distinct
help me to have nil here
I am using this approach in another resources and they are okey but for user!! i have this error
I think some strategies like password
and magic_link
should be changed!! and the token needs to have site in is clame too
Could you please help me where should i start 😂 not to change all things!! i read the docs but i could not find to fix my problem maybe i missed something
Thank you in advance
Gist: https://gist.github.com/shahryarjb/bdb32c98967d315095e131637de45e393 Replies
Sorry for sending the post again. I tried to remove the uniqueness constraint on some fields like email in each section so that they could be read from identities instead. But unfortunately, other errors such as missing username started to appear.
Do I need a custom strategy for this?
You don't need to include
site_id
in the identity fieldsSolution
It is automatically added by virtue of being the multitenancy attribute