mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-08-10 00:52:16 +00:00
Migrated jwt-cpp to stable release, style fixes
This commit is contained in:
committed by
TheElixZammuto
parent
61df838356
commit
968b7963ee
7
.gitmodules
vendored
7
.gitmodules
vendored
@@ -2,6 +2,10 @@
|
||||
path = third-party/build-deps
|
||||
url = https://github.com/LizardByte/build-deps.git
|
||||
branch = dist
|
||||
[submodule "third-party/jwt-cpp"]
|
||||
path = third-party/jwt-cpp
|
||||
url = https://github.com/Thalhammer/jwt-cpp.git
|
||||
branch = master
|
||||
[submodule "third-party/moonlight-common-c"]
|
||||
path = third-party/moonlight-common-c
|
||||
url = https://github.com/moonlight-stream/moonlight-common-c.git
|
||||
@@ -42,6 +46,3 @@
|
||||
path = third-party/wlr-protocols
|
||||
url = https://gitlab.freedesktop.org/wlroots/wlr-protocols
|
||||
branch = master
|
||||
[submodule "third-party/jwt-cpp"]
|
||||
path = third-party/jwt-cpp
|
||||
url = https://github.com/Thalhammer/jwt-cpp.git
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <Simple-Web-Server/crypto.hpp>
|
||||
#include <Simple-Web-Server/server_https.hpp>
|
||||
#include <boost/asio/ssl/context_base.hpp>
|
||||
#include <jwt-cpp/jwt.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "confighttp.h"
|
||||
@@ -32,7 +33,6 @@
|
||||
#include "file_handler.h"
|
||||
#include "globals.h"
|
||||
#include "httpcommon.h"
|
||||
#include "jwt-cpp/jwt.h"
|
||||
#include "logging.h"
|
||||
#include "network.h"
|
||||
#include "nvhttp.h"
|
||||
@@ -784,7 +784,12 @@ namespace confighttp {
|
||||
return;
|
||||
}
|
||||
outputTree.put("status", "true");
|
||||
auto token = jwt::create().set_type("JWS").set_issued_now().set_expires_in(std::chrono::seconds { 3600 }).set_issuer("sunshine-" + http::unique_id).set_payload_claim("sub", jwt::claim(std::string(config::sunshine.username))).sign(jwt::algorithm::hs256 { jwt_key });
|
||||
auto token = jwt::create().set_type("JWT")
|
||||
.set_issued_at(std::chrono::system_clock::now())
|
||||
.set_expires_at(std::chrono::system_clock::now() + std::chrono::seconds{3600})
|
||||
.set_issuer("sunshine-" + http::unique_id)
|
||||
.set_payload_claim("sub", jwt::claim(std::string(config::sunshine.username)))
|
||||
.sign(jwt::algorithm::hs256 { jwt_key });
|
||||
std::stringstream cookie_stream;
|
||||
cookie_stream << "sunshine_session=";
|
||||
cookie_stream << token;
|
||||
|
||||
@@ -6,4 +6,4 @@ export default async (url,config) => {
|
||||
window.dispatchEvent(event);
|
||||
}
|
||||
return response;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -33,14 +33,6 @@
|
||||
'ResourceCard': ResourceCard,
|
||||
'LoginForm': LoginForm
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
a: 1
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
console.log("Ciao!", this.$el)
|
||||
},
|
||||
methods: {
|
||||
onLogin() {
|
||||
document.location.href = '/';
|
||||
@@ -49,4 +41,4 @@
|
||||
});
|
||||
console.log("App", app);
|
||||
app.mount("#app");
|
||||
</script>
|
||||
</script>
|
||||
|
||||
2
third-party/jwt-cpp
vendored
2
third-party/jwt-cpp
vendored
Submodule third-party/jwt-cpp updated: 364a5572f4...08bcf77a68
Reference in New Issue
Block a user