работающая авторизация

This commit is contained in:
2024-11-05 10:33:52 +03:00
parent b561dedb2b
commit 0eacd76810
10 changed files with 150 additions and 61 deletions

View File

@@ -74,7 +74,7 @@ std::string http::auth::jwt::Jwt::getUsername() {
std::string http::auth::jwt::Jwt::asCookie() {
signature = utils::sha256(this->payload + secretKey);
auto val = utils::b64Encode(payload) + "." + signature;
return val + ";Path=/; Max-Age=86400; HttpOnly; SameSite=Lax";
return "auth=" + val + ";Path=/; Max-Age=86400; HttpOnly; SameSite=Lax";
}
http::auth::jwt::Jwt::~Jwt() = default;