Skip to content

Commit 9dc2bca

Browse files
committed
Some connections page fixes
1 parent 57438bd commit 9dc2bca

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

src/routes/(authenticated)/settings/connections/+page.svelte

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import { onMount } from 'svelte';
1616
import { toast } from 'svelte-sonner';
1717
import DisconnectDialog from './dialog-oauth-disconnect.svelte';
18+
import { GetOAuthAuthorizeUrl } from '$lib/api/next/oauth';
1819
1920
// ---------- state
2021
let loading = $state(false); // overall refresh button state
@@ -28,6 +29,8 @@
2829
let providers = $state<string[]>(JSON.parse(sessionStorage.getItem('oAuthProviders') ?? '[]'));
2930
let connections = $state<OAuthConnectionResponse[]>([]);
3031
32+
$inspect(providers);
33+
3134
// Disconnect dialog
3235
let disconnectDialog = $state<{ open: boolean; providerKey?: string; displayName?: string }>({
3336
open: false,
@@ -120,10 +123,15 @@
120123
{#if loadingProviders}
121124
<Dropdown.Item disabled>Loading…</Dropdown.Item>
122125
{:else}
123-
{#each providers as p}
124-
{#if !isConnected(p)}
126+
{#each providers as provider}
127+
{#if !isConnected(provider)}
125128
<Dropdown.Item>
126-
<Link2 class="mr-2 size-4" /> <!-- TODO: Form + button [POST] -->
129+
<Link2 class="mr-2 size-4" />
130+
<form action={GetOAuthAuthorizeUrl(provider, 'Link')} method="POST">
131+
<button type="submit" class="w-full text-left">
132+
{provider}
133+
</button>
134+
</form>
127135
</Dropdown.Item>
128136
{/if}
129137
{/each}

0 commit comments

Comments
 (0)