Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Login System #332

Closed
AkashKrx opened this issue Mar 22, 2021 · 4 comments
Closed

Multiple Login System #332

AkashKrx opened this issue Mar 22, 2021 · 4 comments

Comments

@AkashKrx
Copy link

I am trying to use this library for two authentication systems. One for the admin panel and another one from front-end users. I have modified data migration files and the controller to accommodate that. But I am not sure how to change the table name in the library itself or inform it to use a custom name for tables.

Is it possible to go with this approach or am just wasting my time?

@AkashKrx
Copy link
Author

I also tried this but getting Call to undefined method Myth\Auth\Authentication\LocalAuthenticator::useModel() error.

image

@lonnieezell
Copy link
Owner

For the second case, you mistyped userModel.

I'm confused by what you're trying to do in the first comment, though. Wouldn't it be enough to use groups/roles and restrict who can see it based on that?

@AkashKrx
Copy link
Author

AkashKrx commented Mar 23, 2021

There is a typo in the documentation itself. https://github.com/lonnieezell/myth-auth/blob/develop/docs/authentication.md#user-content-attaching-the-user-model

Also, method userModel or useModel doesn't exist in the Services class instead there are two methods setUserModel and setLoginModel. I tried these methods to load my modified models that contain updated table names but it's still using the default model provided by this library.

$this->auth = Services::authentication("local",new UserModel(), new LoginModel(),true);

$this->auth = Services::authentication();
$this->auth->setUserModel(new UserModel());
$this->auth->setLoginModel(new UserModel());

both codes returning same results

@AkashKrx
Copy link
Author

Didn't think about groups/roles I think I am going to use this approach.

@MGatner MGatner closed this as completed Jul 2, 2021
Repository owner locked and limited conversation to collaborators Jul 2, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants