I am trying to login user to his specific company. In my business domain, every user belongs to a company.
what I am trying to accomplish ?:
get username password and company from login form and if the username and password matches and user belong to the provided company, log him/her in.
I have tried this two things but not succeeded
- created custom auth object
link to docs
gist of my code
- change Authfinder. but I have not clue how to pass company_id in authfinder method.
thancks in advance