Add libauth.ts for centralised authentication
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
import Loading from '$lib/navigation/loading.svelte';
|
||||
import { onMount } from 'svelte';
|
||||
import { uuid } from '$lib/stores/uuid.js';
|
||||
import { checkAuth } from '$lib/libauth';
|
||||
|
||||
const title = 'Register';
|
||||
|
||||
@@ -38,17 +39,14 @@
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
$: {
|
||||
if ($uuid != 'null') {
|
||||
state = 'reg'
|
||||
} else state = 'unreg'
|
||||
}
|
||||
|
||||
/* onMount(async () => {
|
||||
if ($uuid != 'null') {
|
||||
onMount(async () => {
|
||||
const auth = await checkAuth();
|
||||
if (auth.uuidPresent === false) {
|
||||
state = 'unreg';
|
||||
} else if (auth.uuidPresent === true) {
|
||||
state = 'reg';
|
||||
}
|
||||
});*/
|
||||
});
|
||||
</script>
|
||||
|
||||
{#if isLoading}
|
||||
|
||||
Reference in New Issue
Block a user