Bugfixes, Kundendaten, Datenbank Anpassung
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user