Project

General

Profile

AuthWidget::onLoginChange new session id

Added by Maximilian Kleinert about 5 years ago

Hi,

I want to setup some WServer::post connections after an auth event. I connected the signal

session_.login().changed().connect(this, &AuthApplication::authEvent);

as in the Auth2 example. In my authEvent function I create some widgets (on a successful login) and connect them as in the BroadCast example.

Now the problem is that my authEvent is fired before AuthWidget::onLoginChange() gets called. The latter one calls WebSession::generateNewSessionId(), so the old session id was registered for the post event.

How can I enforce that my custom authEvent functions is called after AuthWidget::onLoginChange()?

Best regards

Max


Replies (1)

RE: AuthWidget::onLoginChange new session id - Added by Maximilian Kleinert about 5 years ago

Hi,

I derived from Wt::Auth::AuthWidget and have overridden createLoginView(), createLoggedInView() to create/remove the widgets for authenticated users.

This way the session id is already updated when the createLoginView is called.

Is this the right way to do it?

Best regards

Max

    (1-1/1)