@@ -263,7 +263,12 @@ void CServerHandler::challengeSubmitted(const Pistache::Http::Request& req, Pist
|
||||
|
||||
const auto TOKEN = CToken(FINGERPRINT, std::chrono::system_clock::now());
|
||||
|
||||
response.headers().add(std::make_shared<SetCookieHeader>(std::string{TOKEN_COOKIE_NAME} + "=" + TOKEN.tokenCookie() + "; HttpOnly; Path=/; Secure; SameSite=Lax"));
|
||||
auto hostDomain = req.headers().getRaw("Host").value();
|
||||
if (hostDomain.contains(":"))
|
||||
hostDomain = hostDomain.substr(0, hostDomain.find(':'));
|
||||
|
||||
response.headers().add(
|
||||
std::make_shared<SetCookieHeader>(std::string{TOKEN_COOKIE_NAME} + "=" + TOKEN.tokenCookie() + "; Domain=" + hostDomain + "; HttpOnly; Path=/; Secure; SameSite=Lax"));
|
||||
|
||||
response.send(Pistache::Http::Code::Ok, "Ok");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user