-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* implement most basic auth with authjs w google as provider and protect /crear-receta * implement basic authjs with google as provider * Add sign out screen
- Loading branch information
Showing
9 changed files
with
99 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
import { SvelteKitAuth } from '@auth/sveltekit'; | ||
import Google from '@auth/sveltekit/providers/google'; | ||
|
||
import { SvelteKitAuth } from "@auth/sveltekit" | ||
import Google from "@auth/sveltekit/providers/google" | ||
|
||
export const { handle, signIn } = SvelteKitAuth({ | ||
providers: [Google], | ||
trustHost: true | ||
}) | ||
export const { handle, signIn, signOut } = SvelteKitAuth({ | ||
providers: [Google], | ||
trustHost: true | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { signOut } from '../../auth'; | ||
import type { Actions } from './$types'; | ||
export const actions: Actions = { default: signOut } satisfies Actions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<script lang="ts"> | ||
import { SignOut } from '@auth/sveltekit/components'; | ||
import Protected from '$lib/components/Protected.svelte'; | ||
</script> | ||
|
||
<Protected> | ||
<div class="narrow-page"> | ||
<h2>Estás seguro/a que quieres cerrar sesión?</h2> | ||
<SignOut | ||
options={{ | ||
redirectTo: '/' | ||
}} | ||
signOutPage="cerrar-sesion" | ||
className="w-full" | ||
> | ||
<div slot="submitButton"> | ||
<span> Cerrar sesión </span> | ||
</div> | ||
</SignOut> | ||
</div> | ||
</Protected> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import { signIn } from "../../auth" | ||
import type { Actions } from "./$types" | ||
export const actions: Actions = { default: signIn } | ||
import { signIn } from '../../auth'; | ||
import type { Actions } from './$types'; | ||
export const actions: Actions = { default: signIn }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters