I have taken a close look at the Introduction to Wt::Auth (
https://www.webtoolkit.eu/wt/doc/tutorial/auth.html), and implemented
something like it in my application. I am able to register a user, then
confirm the user's e-mail address by going to the confirmation URL, then
the user can sign in. All of that works wonderfully, but my user class is
never touched.
In the introduction to Wt::Auth, there is a custom User class created in
the default namespace. As far as I can tell, the only reason that class
exists is to give it to the template parameter of
Wt::Auth::AuthInfo<UserType>. It's never used, and no database record is
ever added to that user table, right?
This makes sense to me because, for instance, say the custom user class has
a required 'name' field; the framework doesn't know how to fill out that
name. Of course, the user could have a required address field, too, etc.
The problem is: how do we get a custom user instance persisted?
Does the framework ever give me an opportunity to create an instance of my
user class and persist it? Am I supposed to write logic into my application
such that if a Wt::Auth::User logs in and doesn't have a record in *my*
user table, then I should get any more information I need from him and put
him into my user table? Maybe something like:
if (Wt::Auth::Login::loggedIn())
if (!Wt::Auth::Dbo::UserDatabase::find(Wt::Auth::Login::user()))
getMoreInfoAndCreateUser();
?
I talked on IRC for a while about this, and the helpful fella there has
written his own 'register user' page and creates his own Wt::Auth::User
rather than letting the framework create one for him. It looks like he's
customizing a good deal more than the example linked to above. I'm hoping
to make sense of the example before doing something that customized.
Thanks for helping me understand this!
In Christ,
Aaron Laws
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest