hot fix
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Failing after 9s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Failing after 12s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Failing after 12s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Failing after 9s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Failing after 12s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Failing after 12s
This commit is contained in:
1 parent
fbc5ba375d
commit
b986ab6b0d
1 file changed
+2
-4
+2
-4
@@ -5,14 +5,12 @@
|
|||||||
void verify_token(struct mg_connection *c, struct mg_http_message *hm) {
|
void verify_token(struct mg_connection *c, struct mg_http_message *hm) {
|
||||||
request_with_token *data = check_body(hm);
|
request_with_token *data = check_body(hm);
|
||||||
if (data->error != nullptr) {
|
if (data->error != nullptr) {
|
||||||
mg_http_reply(c, 403, HTTP_HEADERS, "{%m:%m}", MG_ESC("error"),
|
mg_http_reply(c, 403, HTTP_HEADERS, "{%m:false}", MG_ESC("valid"));
|
||||||
MG_ESC(data->error));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const bool valid = jwt_verifyJWT(data->token, JWT_DEFAULT_SECRET);
|
const bool valid = jwt_verifyJWT(data->token, JWT_DEFAULT_SECRET);
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
mg_http_reply(c, 403, HTTP_HEADERS, "{%m:%m}", MG_ESC("error"),
|
mg_http_reply(c, 403, HTTP_HEADERS, "{%m:false}", MG_ESC("valid"));
|
||||||
MG_ESC("invalid token"));
|
|
||||||
free_request_with_token(data);
|
free_request_with_token(data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user