Your problem stems from your endpoint HTTP method. An HTTP GET request cannot have a payload. You should send it as a POST request instead.
On axios:
axios.post(config.url, { username: parametros.username, password: parametros.password }).then(...)
On the hapi side you should set method: 'POST'
in your route definition. That
way you should now have access to the request.payload
property. You should also validate the payload that you receive from your client. Here is some documentation on it: https://hapi.dev/tutorials/validation/?lang=en_US.
Also on a side note, if you want to add a cookie to the response of the server you should set it using the Response Toolkit (the second parameter h
in your handler):
return h.response(someValue).state('auth-cookie', { NOM_USUARIO: account.NOM_USUARIO })
Here is some documentation to help you out:
https://hapi.dev/api/?v=20.1.0#-hstatename-value-options
Good luck and hapi coding. ??
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…