add authentik login

This commit is contained in:
2024-10-31 02:00:15 -07:00
parent aab19fa6c7
commit 0901e242eb
8 changed files with 144 additions and 12 deletions

View File

@@ -6,8 +6,8 @@
let { class: className, ...rest }: {class: string | undefined | null, rest: { [p: string]: unknown }} = $props();
let isLoading = $state(false);
async function onSubmit(event: Event) {
event.preventDefault();
async function onSubmit() {
// event.preventDefault();
isLoading = true;
setTimeout(() => {
@@ -17,12 +17,14 @@
</script>
<div class={cn("grid gap-6", className)} {...rest}>
<Button disabled={isLoading} onclick={onSubmit}>
{#if isLoading}
<LucideLoaderCircle class="mr-2 h-4 w-4 animate-spin" />
{:else}
<img class="mr-2 h-4 w-4" alt="Authentik Logo" src="https://auth.cazzzer.com/static/dist/assets/icons/icon.svg" />
{/if}
Authentik
</Button>
<a href="/auth/authentik">
<Button disabled={isLoading} onclick={onSubmit}>
{#if isLoading}
<LucideLoaderCircle class="mr-2 h-4 w-4 animate-spin" />
{:else}
<img class="mr-2 h-4 w-4" alt="Authentik Logo" src="https://auth.cazzzer.com/static/dist/assets/icons/icon.svg" />
{/if}
Authentik
</Button>
</a>
</div>