keithwhor/nodal

Setting "global" variables from middleware

somecallmemike opened this issue · 1 comments

Is it possible to pass an object for use in controllers from a middleware? I created an authorization middleware for protected routes which calls AccessToken.verify, and I would like to pass the accessToken/user data from it's output to the next controller.

You should have access to the controller object, and we suggest appending user and accessToken to controller.params :).