Reputation: 75
I am trying to call the user's data from the controller, but I get the following error Can not destructure property auth
of 'undefined' or 'null'.
async datosPersona({ auth }) {
console.log(auth.username)
}
async datosPersona({ auth }) {
}
either of the two examples throws the same error
I'm using adonisjs
Upvotes: 1
Views: 6216
Reputation: 44436
The problem is in the call. Somewhere you are doing the equivalent of
datosPersona(undefined)
Upvotes: 1