Claim tenant did not pass validation in multitenancy
Hi, i have multi tendency in my project which let user no tendency or based on his host and put it inside plug
For example
Many actions works with it but when i want to generate token, i have a problem
For example if the tenant is nil i have no problem but if i pass tendency i get this debug
for bypass this in
sign_in_with_password
after i get my data i force it to have tendency nil
As you see i did like this Ash.Query.set_tenant(query, nil)
, but i do not want to do this, where is my problem?
By the way my user can with nil tenant
(master account) or can be with a site and i check the tenant id is same in my db and ets
Master:
normal:
Thank you in advance3 Replies
I think it is from my api pipeline and custom plug! 🤔 because it is loaded after
plug :load_from_bearer
Or if is there an option to disable tendency in creating token,, i think it fixes my problem
https://hexdocs.pm/ash_authentication/dsl-ashauthentication.html#authentication-tokensYou can look up the tenant before loading the token
Solution
Thank you there were some problems in my custom plug 🫄 🚬