Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. if (token_count == 1) {
  2. var user_name = rows[0].user_name;
  3. next();
  4. }else{
  5. data = {
  6. message :"Invalid Token"
  7. }
  8. res.send(data);
  9. }
  10.  
  11. router.post('/dashboard', function (req, res) {
  12. // user_name must be fetched here
  13. console.log("middleware next")
  14.  
  15. if (token_count == 1) {
  16. var user_name = rows[0].user_name;
  17. req.user_name = user_name;
  18. next();
  19. }else{
  20. data = {
  21. message :"Invalid Token"
  22. }
  23. res.send(data);
  24. }
  25.  
  26.  
  27. router.post('/dashboard', function (req, res) {
  28. // user_name must be fetched here
  29. console.log(req.user_name)
  30. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement