Restructure config frontend, add user jwt request

This commit is contained in:
Christoph Kluge
2024-07-04 17:30:16 +02:00
parent 614f694777
commit 9d4767539c
10 changed files with 705 additions and 570 deletions

View File

@@ -1,18 +1,17 @@
<script>
import { Button } from "@sveltestrap/sveltestrap";
import { fetchJwt } from "../../utils.js"
export let user;
let jwt = "";
let jwt = "";
function getUserJwt(username) {
fetch(`/userconfig/jwt/?username=${username}`)
.then((res) => res.text())
.then((text) => {
jwt = text;
navigator.clipboard
.writeText(text)
.catch((reason) => console.error(reason));
});
const p = fetchJwt(username);
p.then((content) => {
jwt = content
}).catch((error) => {
console.error(`Could not get JWT: ${error}`);
});
}
</script>