only create cookie when not existed.
All checks were successful
Deploy / Build (push) Successful in 5m29s

This commit is contained in:
amass 2025-01-02 23:02:37 +08:00
parent 1ba9de15c4
commit fe704cb359

View File

@ -95,10 +95,15 @@ void Application::authEvent() {
}
}
setInternalPath("/", true);
auto app = Amass::Singleton<WebToolkit::Server>::instance();
auto &service = app->authService();
auto &env = environment();
auto token = env.getCookie(service.authTokenCookieName());
if (token == nullptr) {
Wt::Http::Cookie cookie(service.authTokenCookieName(), service.createAuthToken(u));
setCookie(cookie);
}
} else {
m_loginPage = m_navigationBar->removeLoginItem();
LOG(info) << "User logged out.";