Advertisement
Guest User

Untitled

a guest
Apr 12th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 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("/", (req, res, next) => {
  14. if (req.auth.user === login.user && req.auth.password === login.password) {
  15. res.send(response);
  16. }
  17. });
  18.  
  19. app.get("/login", (req, res, next) => {
  20. if (req.auth.user === "admin" && req.auth.password === "admin") {
  21. login = req.auth;
  22. res.send("User Logged");
  23. }
  24. });
  25. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement