Closed snakemastr closed 4 years ago
Hi, 1st question, please provide more details if you can.
2nd question: you can define your own user model in config by setting env variable: https://github.com/vdomah/oc-jwtauth/blob/3b98fc1ecd71bd3fb871382a42e5dbcb5631633e/config/auth.php#L62
I was typing my reply as I noticed that the guard name was empty. If OctoberCMS has a config/auth.php, the auth.php in your plugin is ignored. Does this mean my way of installing plugins is wrong or is this desired behaviour? I would think the configs are extending each other, not overriding completely.. I use the backend plugin manager for installation. I have now pasted your config in my auth.php and the plugin works as expected! Awesome :-D
Also good to know. One of the used plugins creates customer model on login if no model is present so I have to catch that in case of my own User.
Thank you so much
Ah, config/auth.php was added with the recent upgrade to Laravel V6 (Sep 8).
About config/auth.php 1 that surprised me, because I fixed that in past plugin releases. Thanks for pointing that it’s Laravel 6 problem, I’ll investigate
Hey @vdomah I just had the same issue with your Plugin version 1.0.12 and Laravel 6, is this part of a new release?
If you are using WinterCMS you can add the content of oc-jwtauth/config/auth.php
inside wintercms/config/auth.php
and, considering you are using the Winter version of Users pluging you need to change too
'providers' => [
'users' => [
'driver' => env('AUTH_PROVIDERS_USERS_DRIVER', 'eloquent'),
'model' => env('AUTH_PROVIDERS_USERS_MODEL', '\RainLab\User\Models\User'),
],
for
'providers' => [
'users' => [
'driver' => env('AUTH_PROVIDERS_USERS_DRIVER', 'eloquent'),
'model' => env('AUTH_PROVIDERS_USERS_MODEL', '\Winter\User\Models\User'),
],
I have a fresh install octobercms with Octobro/Api and was looking for a good oAuth plugin. Unfortanetly I am getting the error Auth guard is not defined when I'm trying to login. I am creating a login request with Postman POST request and have submitted my fields in the form-data body.
Also, can I create a user for the API only? Right now it is mixing with my customers users but I would like to restrict the API user(s) or group to the API only.