F
Filamentβ€’7mo ago
raush

filament login

Could the issue with encountering the "These credentials do not match our records" error when having duplicate user credentials but belonging to different tenants be related to how authentication and user management are handled in your application in filament 3 laravel?
5 Replies
toeknee
toekneeβ€’7mo ago
This doesn't make sense, how do you have duplicate user logins? How are you spliting them between tenants? I would expect 1 login assigned to multiple tenants.
raush
raushOPβ€’7mo ago
Okay! but i am concerned that i have two different company panels and both have different users names and may belong to different roles. Both users use the same login email id but passwords are different for both users. Please tell me how to fix it
Tetracyclic
Tetracyclicβ€’7mo ago
Laravel's built-in authentication uses the email as a key for the user, so it needs to be unique. If at all possible I'd avoid having multiple accounts with the same email and instead handle the different names/roles within the same account, based on the currently selected tenant/company. You'd certainly need some way for the user to identify the account uniquely other than password, as a user may want to use the same password for both accounts. If you absolutely had to have entirely separate accounts with the same email, you'd need to implement your own authentication provider that combines properties that are unique and handles returning the correct account. Laravel has docs for how to do that: https://laravel.com/docs/11.x/authentication#adding-custom-guards https://laravel.com/docs/11.x/authentication#adding-custom-user-providers
toeknee
toekneeβ€’7mo ago
You really should look at Spatie Permissions with teams support as thats what you should be using, and if they create a new account and an account already exists you just assign the permissions for that team with assigning the team.
raush
raushOPβ€’7mo ago
Okay thanks πŸ‘
Want results from more Discord servers?
Add your server