I have a SessionController, which is the method that performs the user authentication process in the application.
class SessionController {
async store ({ request, response, auth }) {
const data = request.all()
const token = await auth.attemp(data.email, data.password)
return token
}
}
My routes.js, I also have the instance of this method for mapping the API:
Route.post('/sessions', 'SessionController.store')
The user data, already in the database, the problem is that when I make the request, I get a 500 error.
I debugged the application, and it seems that the application does not run after the const token = await auth.attemp(data.email, data.password)
line.
No idea what it can be!