почти рабочая авторизация. оказывается сейчас нет payload у запроса, поэтому невозможно распарсить из него json.
This commit is contained in:
@@ -4,10 +4,20 @@
|
||||
#include "resources.h"
|
||||
|
||||
namespace http::auth::jwt {
|
||||
extern std::string secretKey;
|
||||
|
||||
void generateSecretKey();
|
||||
|
||||
/**
|
||||
* Упрощенная реализация JWT (Json Web Token). Токен имеет вид: `{ username | base64 }.{ signature | base64 }`.
|
||||
* Сигнатура вычисляется следующим образом: `SHA256(username + secret)`.
|
||||
* Имя cookie: `auth`.
|
||||
*/
|
||||
class Jwt {
|
||||
std::string payload;
|
||||
std::string signature;
|
||||
public:
|
||||
static Jwt fromCookies(const std::string& cookie);
|
||||
static Jwt fromString(const std::string& cookie);
|
||||
static Jwt fromUser(const std::string& User);
|
||||
|
||||
bool isValid();
|
||||
|
Reference in New Issue
Block a user