--
You received this message because you are subscribed to the Google Groups "Lift" group.
To view this discussion on the web visit https://groups.google.com/d/msg/liftweb/-/4OaBvzIvqboJ.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Regarding your question;
I don't think there is such a thing ready-made, but it would be rather
simple to do. Instead of just doing:
onLogIn = List(MyExtendedSession.userDidLogin _)
onLogOut = List(MyExtendedSession.userDidLogout _)
in your User Meta, you would probably want to add the checkbox to your
login-form and then only call MyExtendedSession.userDidLogin if it was
checked.
You could of course trait-ify this with a self-type of ProtoUser that:
* adds a boolean field on the model (doesn't need to be mapped, right?)
* overrides def loginXhtml to include the checkbox and save it to the model
* puts a hook in onLogIn: List[TheUserType => Unit] to call
MyExtendedSession.userDidLogin _ if the field was set
but it feels rather crappy to add an extra field on the user model
just for this since it shouldn't really be part of the model, but
should have a life time just tied to the login-form. I don't see any
other simple way though since the hooks are defined on the model.
Hm, I think I would just make my a custom login-page instead.
Cheers,
/v