Encode header to base64
This commit is contained in:
@ -4,6 +4,7 @@
|
||||
|
||||
#include "jwt.h"
|
||||
#include "dev_name.h"
|
||||
#include "crypto.h"
|
||||
|
||||
#include "esp_log.h"
|
||||
|
||||
@ -34,7 +35,19 @@ char *jwt_gen(cJSON *payload)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
printf("header: %s\n", header);
|
||||
char *header_b64 = crypto_encode_base64_safe_url(header, strlen(header));
|
||||
free(header);
|
||||
|
||||
if (!header_b64)
|
||||
{
|
||||
ESP_LOGE(TAG, "Failed to encode header to base64!");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
printf("header = %s\n", header_b64);
|
||||
|
||||
free(header_b64);
|
||||
|
||||
// TODO : continue
|
||||
return strdup("TODO:)");
|
||||
}
|
Reference in New Issue
Block a user