You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have created multiple guards and providers in auth.php. I have User model and AdminUser model. I can actually login and generate JWT token in both cases. But then problem is in my auth middleware where I try to check if the user is authenticated. The below code (It resides inside a middleware) always checks the default Users model and not the admin users model. Is there any way to fix it?
I don't overly understand your issue (in particular the user model vs admin model), but the way dingo authentication works is it just goes down the list of authentication providers until one authenticates, and if none do, then it considers the request unauthenticated.
Actual Behaviour
I have created multiple guards and providers in auth.php. I have User model and AdminUser model. I can actually login and generate JWT token in both cases. But then problem is in my auth middleware where I try to check if the user is authenticated. The below code (It resides inside a middleware) always checks the default Users model and not the admin users model. Is there any way to fix it?
$this->auth->authenticate($route->getAuthenticationProviders());
The text was updated successfully, but these errors were encountered: