Bugfixes, Kundendaten, Datenbank Anpassung

This commit is contained in:
Moritz Utcke
2024-01-10 15:09:30 +07:00
parent ee5133b3f8
commit b20b857a7d
60 changed files with 737 additions and 1647 deletions

View File

@@ -7,12 +7,20 @@
let passwort: string;
async function login() {
const response = await client.v1.benutzer.tokenErneuern.query({
email,
passwort
})
if (!response.token || !response.exp) {
try {
const response = await client.v1.benutzer.getRefreshToken.query({
email,
passwort
})
const options = {
domain: `.${window.location.hostname}`,
path: "/",
expires: response.exp
}
Cookies.set("accessToken", response.accessToken, options);
Cookies.set("refreshToken", response.refreshToken, options);
window.location.href = "/user";
} catch (e) {
addNotification({
message: "Ups...",
subtext: "Das hat leider nicht geklappt, haben sie ihr Passwort und ihre Email Adresse richtig eingegeben?",
@@ -20,16 +28,7 @@
timeout: 6000,
dismissable: true
})
return;
}
const options = {
domain: `.${window.location.hostname}`,
path: "/",
expires: response.exp
}
Cookies.set("token", response.token, options);
window.location.href = "/user";
}
</script>