Browse Source

Small fixes here and there.

master
Zed A. Shaw 4 months ago
parent
commit
0f193a88a6
  1. 14
      client/pages/Home.svelte
  2. 4
      client/pages/UserProfile.svelte
  3. 3
      rendered/pages/index.svelte

14
client/pages/Home.svelte

@ -1,4 +1,18 @@
<script>
import { push } from "svelte-spa-router";
import { user } from "../stores.js";
import { onMount } from "svelte";
onMount(async () => {
if(!$user.authenticated) {
push("/login/");
}
});
</script>
{#if $user.authenticated}
<main data-testid="home-page">
<h1>Home Page</h1>
</main>
{/if}

4
client/pages/UserProfile.svelte

@ -65,9 +65,10 @@
</script>
<style>
</style>
{#if $user.authenticated}
<main>
<section>
<form action="/api/register" method="POST">
@ -107,4 +108,5 @@
</form>
</section>
</main>
{/if}

3
rendered/pages/index.svelte

@ -4,6 +4,7 @@
return { test_data: ["Test", "That"]};
}
</script>
<script>
import {link} from 'svelte-spa-router';
import {user} from '$client/stores';
@ -146,7 +147,7 @@
<span>
<h1>Learn JS The Hard Way</h1>
<p>A learnable starter project.</p>
<a href="/client/#/home/" use:link><i>Log In</i></a>
<a href="/client/#/login/" use:link><i>Login</i></a>
</span>
</header>

Loading…
Cancel
Save