|
|
|
@ -1,6 +1,7 @@ |
|
|
|
import * as API from "../api" |
|
|
|
import { writable } from "svelte/store" |
|
|
|
import { initialise } from "./initialise" |
|
|
|
import { routeStore } from "./routes" |
|
|
|
|
|
|
|
const createAuthStore = () => { |
|
|
|
const store = writable(null) |
|
|
|
@ -14,7 +15,6 @@ const createAuthStore = () => { |
|
|
|
routeStore.actions.navigate("/") |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Fetches the user object if someone is logged in and has reloaded the page
|
|
|
|
const fetchUser = async () => { |
|
|
|
const user = await API.fetchSelf() |
|
|
|
|