improve layout, nav; add sign out on user page
This commit is contained in:
@@ -6,25 +6,17 @@
|
||||
let { class: className, ...rest }: {class: string | undefined | null, rest: { [p: string]: unknown }} = $props();
|
||||
|
||||
let isLoading = $state(false);
|
||||
async function onSubmit() {
|
||||
// event.preventDefault();
|
||||
isLoading = true;
|
||||
|
||||
setTimeout(() => {
|
||||
isLoading = false;
|
||||
}, 3000);
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class={cn("grid gap-6", className)} {...rest}>
|
||||
<a href="/auth/authentik">
|
||||
<Button disabled={isLoading} onclick={onSubmit}>
|
||||
<form method="get" action="/auth/authentik">
|
||||
<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="Authentik Logo" src="https://auth.cazzzer.com/static/dist/assets/icons/icon.svg" />
|
||||
{/if}
|
||||
Authentik
|
||||
Sign in with Authentik
|
||||
</Button>
|
||||
</a>
|
||||
</form>
|
||||
</div>
|
||||
|
@@ -41,6 +41,10 @@ export async function invalidateSession(sessionId: string): Promise<void> {
|
||||
await db.delete(table.session).where(eq(table.session.id, sessionId));
|
||||
}
|
||||
|
||||
export function deleteSessionTokenCookie(event: RequestEvent) {
|
||||
event.cookies.delete(sessionCookieName, { path: '/' });
|
||||
}
|
||||
|
||||
export async function validateSession(sessionId: string) {
|
||||
const [result] = await db
|
||||
.select({
|
||||
|
Reference in New Issue
Block a user