diff --git a/src/ui/Auth.cpp b/src/ui/Auth.cpp index d4fbc093..961d2fb4 100644 --- a/src/ui/Auth.cpp +++ b/src/ui/Auth.cpp @@ -32,16 +32,11 @@ namespace UserInterface { Auth::Auth() -: Wt::WTemplateFormView() +: Wt::WTemplateFormView(Wt::WString::tr("Lms.Auth.template")) { _model = std::make_shared(LmsApp->getDb().getAuthService(), LmsApp->getDb().getUserDatabase()); - _model->addPasswordAuth(&Database::Handler::getPasswordService()); - setTemplateText(Wt::WString::tr("Lms.Auth.template")); - addFunction("tr", &WTemplate::Functions::tr); - addFunction("id", &WTemplate::Functions::id); - // LoginName setFormWidget(Wt::Auth::AuthModel::LoginNameField, std::make_unique()); @@ -63,8 +58,9 @@ Auth::Auth() this->setHidden(true); })); - Wt::Auth::User user = _model->processAuthToken(); - _model->loginUser(LmsApp->getDb().getLogin(), user, Wt::Auth::LoginState::Weak); +// Wt::Auth::User user = _model->processAuthToken(); +// if (user.isValid()) +// _model->loginUser(LmsApp->getDb().getLogin(), user, Wt::Auth::LoginState::Weak); updateView(_model.get()); }