@tuentyfaiv/svelte-auth
v0.1.0
Published
A SvelteKit library to handle authorization.
Downloads
7
Readme
Svelte Auth
npm install @tuentyfaiv/svelte-auth
Examples
Instance context
<!-- +layout.svelte -->
<script lang="ts">
import { authContext } from "@tuentyfaiv/svelte-auth";
// configure auth routes and redirection url
authContext(["/signin", "/forgot"], "/");
</script>
Protect page
<!-- +page.svelte -->
<script lang="ts">
import { Auth } from "@tuentyfaiv/svelte-auth";
</script>
<Auth>
<!-- ...content -->
</Auth>