Guest User

Untitled

a guest
Oct 22nd, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. // for everyauth
  2. mongoose.model("User", UserSchema);
  3.  
  4. var User = mongoose.model("User");
  5.  
  6. // plugin called AFTER mongoose.model
  7. // Model doesn't get decorated with authenticate() method
  8. UserSchema.plugin(mongooseAuth, {
  9. everymodule:
  10. {
  11. everyauth:
  12. {
  13. User: function()
  14. {
  15. return User;
  16. }
  17. }
  18. },
  19.  
  20. password:
  21. {
  22. everyauth:
  23. {
  24. getLoginPath: "/login",
  25. postLoginPath: "/login",
  26. loginView: "login.hbs",
  27. getRegisterPath: "/users/new",
  28. postRegisterPath: "/users/new",
  29. registerView: "signup.hbs",
  30. loginSuccessRedirect: "/",
  31. registerSuccessRedirect: "/"
  32. }
  33. }
  34.  
  35. });
Add Comment
Please, Sign In to add comment