mirror of
https://github.com/SrIzan10/next-auth.git
synced 2026-05-01 10:55:20 +00:00
seems to work now
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
<script lang="ts">
|
||||
export let provider: any
|
||||
export let callbackUrl: string
|
||||
</script>
|
||||
|
||||
<form action={provider.signinUrl} method="POST">
|
||||
{#if provider.callbackUrl}
|
||||
<input type="hidden" name="callbackUrl" value={provider.callbackUrl} />
|
||||
{/if}
|
||||
<button type="submit" class="button">
|
||||
<input type="hidden" name="callbackUrl" value={callbackUrl} />
|
||||
<button type="submit">
|
||||
<slot>Sign in with {provider.name}</slot>
|
||||
</button>
|
||||
</form>
|
||||
|
||||
@@ -4,5 +4,6 @@ export const load: LayoutServerLoad = async (event) => {
|
||||
return {
|
||||
session: await event.locals.getSession(),
|
||||
providers: await event.locals.getProviders(),
|
||||
callbackUrl: new URL(event.request.url).host,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,11 +19,11 @@
|
||||
>
|
||||
</span>
|
||||
<form action="/auth/signout" method="POST">
|
||||
<button id="submitButton" type="submit">Sign out</button>
|
||||
<button type="submit">Sign out</button>
|
||||
</form>
|
||||
{:else}
|
||||
<span class="notSignedInText">You are not signed in</span>
|
||||
{#each Object.values($page.data.providers) as provider}
|
||||
<SignInButton {provider} />
|
||||
<SignInButton {provider} callbackUrl={$page.data.callbackUrl} />
|
||||
{/each}
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user