Fix in auth
This commit is contained in:
@@ -4,14 +4,14 @@
|
||||
|
||||
$: loginRendered = false;
|
||||
|
||||
onMount(() => {
|
||||
onMount(async () => {
|
||||
try {
|
||||
userstore.loginFromStorage();
|
||||
await userstore.loginFromStorage();
|
||||
loginRendered = true;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
userstore.logout();
|
||||
location.replace(`${location.pathname}/login`);
|
||||
location.replace(`/login`);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user