Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (token_count == 1) {
- var user_name = rows[0].user_name;
- next();
- }else{
- data = {
- message :"Invalid Token"
- }
- res.send(data);
- }
- router.post('/dashboard', function (req, res) {
- // user_name must be fetched here
- console.log("middleware next")
- if (token_count == 1) {
- var user_name = rows[0].user_name;
- req.user_name = user_name;
- next();
- }else{
- data = {
- message :"Invalid Token"
- }
- res.send(data);
- }
- router.post('/dashboard', function (req, res) {
- // user_name must be fetched here
- console.log(req.user_name)
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement