checking for uzer logged in with specific middleware, implemented merge library to use on res.locals