//middleware
if(!token){
return res.redirect('/')
} else {
const decrypt = jwt.verify(token, process.env.JWT_SECRET)
req.user = {
email: decrypt.email,
role: decrypt.role,
balance: decrypt.balance
}