mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-21 23:16:54 +00:00
logs to account middleware
This commit is contained in:
1 parent
a1c228b1d1
commit
f0c094e9d8
1 file changed
+5
-1
+5
-1
@@ -91,12 +91,16 @@ app.use(cors(corsOptions));
|
||||
|
||||
//Account Middleware
|
||||
app.use((req, res, next)=>{
|
||||
console.log('passing through acc middleware')
|
||||
if(req.cookies && req.cookies.nc_session){
|
||||
try {
|
||||
console.log(`creating req.account equal to "${jwt.decode(req.cookies.nc_session, config.get('secret'))}"`);
|
||||
req.account = jwt.decode(req.cookies.nc_session, config.get('secret'));
|
||||
//console.log("Just loaded up JWT from cookie:");
|
||||
//console.log(req.account);
|
||||
} catch (e){}
|
||||
} catch (e){
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
|
||||
req.config = {
|
||||
|
||||
Reference in new issue
Block a user