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.56 KB | None | 0 0
  1. // plugin called BEFORE mongoose.model
  2. // Model gets properly decorated
  3.  
  4. UserSchema.plugin(mongooseAuth, {
  5. everymodule:
  6. {
  7. everyauth:
  8. {
  9. User: function()
  10. {
  11. return User;
  12. }
  13. }
  14. },
  15.  
  16. password:
  17. {
  18. everyauth:
  19. {
  20. getLoginPath: "/login",
  21. postLoginPath: "/login",
  22. loginView: "login.hbs",
  23. getRegisterPath: "/users/new",
  24. postRegisterPath: "/users/new",
  25. registerView: "signup.hbs",
  26. loginSuccessRedirect: "/",
  27. registerSuccessRedirect: "/"
  28. }
  29. }
  30.  
  31. });
  32.  
  33. // for everyauth
  34. mongoose.model("User", UserSchema);
  35.  
  36. var User = mongoose.model("User");
Add Comment
Please, Sign In to add comment