auth: work on adding google auth via invite

This commit is contained in:
2025-03-14 01:08:42 -07:00
parent 073bf65094
commit 02ff13e4d3
19 changed files with 577 additions and 100 deletions

View File

@@ -2,14 +2,16 @@
import { LucideLoaderCircle } from 'lucide-svelte';
import { Button } from '$lib/components/ui/button';
import { cn } from '$lib/utils.js';
import googleIcon from '$lib/assets/google.svg';
let { class: className, ...rest }: { class?: string; rest?: { [p: string]: unknown } } = $props();
let { inviteToken, class: className, ...rest }: { inviteToken?: string; class?: string; rest?: { [p: string]: unknown } } = $props();
let isLoading = $state(false);
</script>
<div class={cn('flex gap-6', className)} {...rest}>
<form method="get" action="/auth/authentik">
<form method="get" action="/auth/authentik{inviteToken ? `?invite=${inviteToken}` : ''}">
<input type="hidden" value={inviteToken} name="invite" />
<Button
type="submit"
onclick={() => {
@@ -28,4 +30,24 @@
Sign in with Authentik
</Button>
</form>
<form method="get" action="/auth/google">
<input type="hidden" value={inviteToken} name="invite" />
<Button
type="submit"
onclick={() => {
isLoading = true;
}}
>
{#if isLoading}
<LucideLoaderCircle class="mr-2 h-4 w-4 animate-spin" />
{:else}
<img
class="mr-2 h-4 w-4"
alt="Google Logo"
src={googleIcon}
/>
{/if}
Sign in with Google
</Button>
</form>
</div>