web_backend: protect jwt cache with a mutex

This commit is contained in:
Weiyi Wang 2018-09-17 14:28:58 -04:00 committed by fearlessTobi
parent 120d8f3bf7
commit 62f9409ba3
2 changed files with 4 additions and 1 deletions

View file

@ -5,7 +5,7 @@
#pragma once
#include <functional>
#include <future>
#include <mutex>
#include <string>
#include <tuple>
#include <httplib.h>
@ -81,6 +81,7 @@ private:
std::unique_ptr<httplib::Client> cli;
struct JWTCache {
std::mutex mutex;
std::string username;
std::string token;
std::string jwt;