Yii authentication via user module

Asked

Viewed 306 times

0

I’m using the user module Yii code is on this link, only that in my database I also have a client table.

Is it possible to use the user module login to authenticate the client or do I have to create another client login? Or I can relate the client table to the module user table?

3 answers

1

You can do yes, but you will need to create the model and adapt the login functions to get the new model with its rules.

I still think it would be more practical to log in from scratch.

0

The best solution would be to refactor to use only one login, you could use RBAC to set the access rules for each Profile/Login as well. Doing it this way, you’ll have less work if the project you’re working on is scalable.

0

You can create both, and put an FK on your client by directing to the extension login.

It’s not very nice to create a one-to-one relationship, but it solves your problems. When the user logs in, there will only be one client that has that user id, so you know which client is logged in.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.