in process of scaling data service and cleaner reducers
This commit is contained in:
@@ -5,10 +5,12 @@ module.exports = (req, res, next) => {
|
||||
try {
|
||||
const token = req.headers.authorization.split(' ')[1];
|
||||
const decoded = jwt.verify(token, process.env.JWT_KEY);
|
||||
req.userData = decoded; //for use till end of request
|
||||
req.user_data = decoded; //for use till end of request
|
||||
|
||||
next();
|
||||
} catch (error) {
|
||||
error.message = 'Check Auth Error';
|
||||
error.status = 401;
|
||||
return next(error);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user