SHARE
TWEET

Untitled

a guest Feb 27th, 2020 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.   app.get("/dashboard", (req, res) => {
  3.     if(req.cookies["token"]) {
  4.       Promise.all([getUser(req.cookies["token"]), getGuilds(req.cookies["token"])]).then(([user, guilds]) => {
  5.         res.render("views/dashboard", { user: user, guilds: guilds, client: client, req: req, id: undefined, Permissions: Permissions });
  6.       })
  7.     }
  8.     else {
  9.       res.render("views/dashboard", { user: undefined, guilds: undefined, client: client, req: req, id: undefined, Permissions: Permissions})
  10.     }
  11.   })
  12.  
  13.   app.get("/dashboard/:id", (req, res) => {
  14.     const id = req.params.id
  15.     if(client.guilds.get(id)) {
  16.     if(req.cookies["token"]) {
  17.       Promise.all([getUser(req.cookies["token"]), getGuilds(req.cookies["token"])]).then(([user, guilds]) => {
  18.         res.render("views/dashboard", { user: user, guilds: guilds, client: client, req: req, id: id, Permissions: Permissions});
  19.       })
  20.     }
  21.    else {
  22.       res.render("views/dashboard", { user: undefined, guilds: undefined, client: client, req: req, id: undefined, Permissions: Permissions})
  23.     }
  24.  } else {
  25.     res.redirect("/404")
  26.   }})
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top