Replies: 1 comment
-
somehow i managed to solve this problem, i don't know exactly why it was giving me that error so i created another project and moved all my controllers migrations and the other js files i created to this new project but this time i didn't changed the user migration, model and controller so instead of a pivot table named usuario i got the default users table and it worked. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
i'm trying to make an user authentication with the jwt but it gives me a typeError
so what i have is a model user called usuario responsible for the users tables on the database and i made a controller for user authentication that is called on the login route with a post method
------------// users Model //--------------------------------
and this is the error i get:
error here: TypeError: Cannot read property 'query' of undefined
at LucidSerializer._getQuery (C:\Users\hehehe\Desktop\devWork\icarus_server\node_modules@adonisjs\auth\src\Serializers\Lucid.js:61:31)
at LucidSerializer.findByUid (C:\Users\hehehe\Desktop\devWork\icarus_server\node_modules@adonisjs\auth\src\Serializers\Lucid.js:179:17)
at JwtScheme.validate (C:\Users\hehehe\Desktop\devWork\icarus_server\node_modules@adonisjs\auth\src\Schemes\Base.js:187:49)
at JwtScheme.attempt (C:\Users\hehehe\Desktop\devWork\icarus_server\node_modules@adonisjs\auth\src\Schemes\Jwt.js:214:29)
at UserLoginController.landing (C:\Users\hehehe\Desktop\devWork\icarus_server\app\Controllers\Http\UserLoginController.js:12:20)
at Server._routeHandler (C:\Users\hehehe\Desktop\devWork\icarus_server\node_modules@adonisjs\framework\src\Server\index.js:121:31)
at MiddlewareBase._resolveMiddleware (C:\Users\hehehe\Desktop\devWork\icarus_server\node_modules@adonisjs\middleware-base\index.js:195:28)
at Runnable._invoke (C:\Users\hehehe\Desktop\devWork\icarus_server\node_modules\co-compose\src\Runnable.js:76:42)
at once (C:\Users\hehehe\Desktop\devWork\icarus_server\node_modules\co-compose\src\Runnable.js:73:34)
at f (C:\Users\hehehe\Desktop\devWork\icarus_server\node_modules\once\once.js:25:25)
Beta Was this translation helpful? Give feedback.
All reactions