-
Notifications
You must be signed in to change notification settings - Fork 231
Description
I got a system which provides instances for separate tenants/clients. Each tenant/client can manage their own users. The user table has therefore not only username (email) and credential columns, but also a client column, associating each user to a specific client. Sometimes there are several clients configured by the same people so they create the same usernames for different clients. Sorcery cannot handle this setup. The login method only allows for username, password arguments and does not allow to also specify additional selection criteria (in my case the current client the user wants to login to which is based on the FQDN). The result is that Sorcery finds more than just one result for the username and aborts the login while in fact the usernames are unique PER client.
Do I need to monkey-patch ActiveRecordAdapter#find_by_credentials or write my own adapter to achieve this?