totaljs / framework

Node.js framework
http://www.totaljs.com
Other
4.36k stars 450 forks source link

AUTH global function is recieving undefined in $.params #783

Closed LandyCuadra closed 3 years ago

LandyCuadra commented 3 years ago

Hi, I am having a problem with the AUTH global, I am trying to evaluate some GET routes based on a param they send in the route... but when I try to get the value, I get this error

Cannot destructure property 'clientid' of '$.params' as it is undefined

any idea of what I may be doing wrong?....

petersirka commented 3 years ago

@LandyCuadra. The framework executes the AUTH() method before is evaluated routing because the routing needs information about the result from the AUTH() method.

LandyCuadra commented 3 years ago

so there si no way to do that?, because the documentation shows I could access those properties..

https://docs.totaljs.com/total4/407ff001jy51c/#4893f001wa51c -> in "+possibilities"

petersirka commented 3 years ago

My mistake. It's fixed. Thank you

LandyCuadra commented 3 years ago

great!, thank you