Skip to content

Commit

Permalink
refactor(ceremony): loop render button instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Swepool committed Sep 18, 2024
1 parent 280b359 commit d8241e1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ceremony/src/routes/auth/dive/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<script lang="ts">
import Button from "$lib/components/Button.svelte"
import Spinner from "$lib/components/Spinner.svelte"
import { page } from "$app/stores"
import { supabase } from "$lib/supabase/client.ts"
// import Spinner from "$lib/components/Spinner.svelte"
async function diveIn(provider: "github" | "google") {
type AuthProviders = "github" | "google"
const providers: Array<AuthProviders> = ["github", "google"]
async function diveIn(provider: AuthProviders) {
const { data, error } = await supabase.auth.signInWithOAuth({
provider: provider,
options: {
Expand All @@ -25,8 +28,9 @@ async function diveIn(provider: "github" | "google") {
{/snippet}

<div class="p-8 flex items-center flex-col gap-4">
{@render Dive('github')}
{@render Dive('google')}
{#each providers as provider}
{@render Dive(provider)}
{/each}
</div>

<!--{#if loading}-->
Expand Down

0 comments on commit d8241e1

Please sign in to comment.