fix(href): replaced location.replace with goto

This commit is contained in:
Nicolai Ort 2023-04-19 13:04:44 +02:00
parent a3e437d966
commit 8959223016
Signed by: niggl
GPG Key ID: 13AFA55AF62F269F
2 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,5 @@
<script lang="ts"> <script lang="ts">
import { goto } from '$app/navigation';
import userstore from '$lib/userstore'; import userstore from '$lib/userstore';
import { AuthService } from '@odit/lfk-client-js'; import { AuthService } from '@odit/lfk-client-js';
@ -14,7 +15,7 @@
})) as import('@odit/lfk-client-js').ResponseAuth; })) as import('@odit/lfk-client-js').ResponseAuth;
loginError=false; loginError=false;
await userstore.login(auth); await userstore.login(auth);
location.replace('./registration'); goto('./registration', {replaceState: true})
} catch (error) { } catch (error) {
console.log(error); console.log(error);
loginError = true; loginError = true;

View File

@ -1,4 +1,5 @@
<script lang="ts"> <script lang="ts">
import { goto } from '$app/navigation';
import userstore from '$lib/userstore'; import userstore from '$lib/userstore';
import { onMount } from 'svelte'; import { onMount } from 'svelte';
@ -11,7 +12,7 @@
} catch (error) { } catch (error) {
console.log(error); console.log(error);
userstore.logout(); userstore.logout();
location.replace(`./login`); goto('./login', {replaceState: true})
} }
}); });
</script> </script>