Advertisement
Guest User

Untitled

a guest
Apr 12th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. let login = {
  2. user: "",
  3. password: ""
  4. };
  5.  
  6. const response = {
  7. kurwy: "Whore",
  8. wino: "Vine",
  9. pianino: "Piano"
  10. };
  11.  
  12. module.exports = app => {
  13. app.get("/kurwy", (req, res, next) => {
  14. if (req.auth.user === login.user && req.auth.password === login.password) {
  15. res.send(response.kurwy);
  16. }
  17. });
  18.  
  19. module.exports = app => {
  20. app.get("/wino", (req, res, next) => {
  21. if (req.auth.user === login.user && req.auth.password === login.password) {
  22. res.send(response.wino);
  23. }
  24. });
  25.  
  26. module.exports = app => {
  27. app.get("/pianino", (req, res, next) => {
  28. if (req.auth.user === login.user && req.auth.password === login.password) {
  29. res.send(response.pianino);
  30. }
  31. });
  32.  
  33. app.get("/login", (req, res, next) => {
  34. if (req.auth.user === "admin" && req.auth.password === "admin") {
  35. login = req.auth;
  36. res.send("User Logged");
  37. }
  38. });
  39. }}};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement