From 18c458d91ca5e7187ffb3615fca8970fc6e4ca65 Mon Sep 17 00:00:00 2001
From: ivarlovlie <git@ivarlovlie.no>
Date: Mon, 6 Jun 2022 15:48:53 +0200
Subject: feat: More work on portal

---
 apps/portal/src/app/pages/login.svelte | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'apps/portal/src/app/pages/login.svelte')

diff --git a/apps/portal/src/app/pages/login.svelte b/apps/portal/src/app/pages/login.svelte
index 2822be0..db010d2 100644
--- a/apps/portal/src/app/pages/login.svelte
+++ b/apps/portal/src/app/pages/login.svelte
@@ -1,7 +1,7 @@
 <script>
 	import {onMount} from "svelte";
-	import {link, querystring} from "svelte-spa-router";
-	import {api_base, projects_base, IconNames} from "$shared/lib/configuration";
+	import {link, replace, querystring} from "svelte-spa-router";
+	import {api_base, projects_base, IconNames, frontpage_base} from "$shared/lib/configuration";
 	import Button from "$shared/components/button.svelte";
 	import Alert from "$shared/components/alert.svelte";
 	import Tile from "$shared/components/tile.svelte";
@@ -47,7 +47,7 @@
 				try {
 					const response = await login(loginForm.values);
 					if (response.ok) {
-						location.replace(projects_base("#/home"));
+						await replace("#/home");
 					} else {
 						if (response.data.title || response.data.text) {
 							loginForm.alert.show("error", {
@@ -62,7 +62,6 @@
 						}
 					}
 				} catch (e) {
-					console.error(e);
 					loginForm.alert.show("error", {
 						title: "An error occured",
 						text: "Could not connect to server, please check your internet connection",
@@ -93,6 +92,7 @@
 </script>
 
 <Layout>
+    <a href="{frontpage_base()}" class="block margin-bottom-xs">Go to {frontpage_base()}</a>
     <Tile>
         <form on:submit|preventDefault={loginForm.submit_form}
               class="max-width-xxs">
-- 
cgit v1.3

