11#include <Wt/WStackedWidget.h>
12#include <Wt/WApplication.h>
13#include <Wt/Auth/AuthWidget.h>
28 auto authWidget = std::make_unique<Auth::AuthWidget>(
session_.
login());
29 auto authWidgetPtr = authWidget.get();
30 authWidget->setModel(std::move(authModel));
31 authWidget->setRegistrationEnabled(
true);
33 addNew<WText>(
"<h1>A Witty game: Hangman</h1>");
35 addWidget(std::move(authWidget));
40 links_ = addNew<WContainerWidget>();
41 links_->setStyleClass(
"links");
48 scoresAnchor_->setLink(WLink(LinkType::InternalPath,
"/highscores"));
50 WApplication::instance()->internalPathChanged()
53 authWidgetPtr->processEnvironment();
72 if (internalPath ==
"/play")
74 else if (internalPath ==
"/highscores")
77 WApplication::instance()->setInternalPath(
"/play",
true);
WContainerWidget * links_
void handleInternalPath(const std::string &internalPath)
Wt::WAnchor * scoresAnchor_
HighScoresWidget * scores_
Wt::WStackedWidget * mainStack_
Wt::WAnchor * backToGameAnchor_
static const Wt::Auth::AbstractPasswordService & passwordAuth()
std::string userName() const
static const Wt::Auth::AuthService & auth()
static std::vector< const Wt::Auth::OAuthService * > oAuth()
Wt::Auth::Login & login()
Wt::Auth::AbstractUserDatabase & users()