File tree Expand file tree Collapse file tree
src/routes/(authenticated)/settings/connections Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
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 ,
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 }
You can’t perform that action at this time.
0 commit comments