Skip to content

Commit

Permalink
feat: un utilisateur peut se déconnecter
Browse files Browse the repository at this point in the history
ref: Un utilisateur connecté peut se déconnecter #8
  • Loading branch information
bachrc committed Oct 20, 2024
1 parent 36b66c7 commit d667879
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/routes/logout/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<script lang="ts">
import { goto } from '$app/navigation';
import { pb } from '$lib/database';
pb.authStore.clear();
goto('/');
</script>
4 changes: 4 additions & 0 deletions src/routes/profil/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,9 @@
<span class="text-xs font-bold">Adresse mail</span>
<span>{currentUser.value?.email}</span>
</div>
<hr class="h-px my-8 bg-gray-200 border-0 dark:bg-gray-300" />
<a href="/logout">
<span class="text-red-700 font-semibold">Se déconnecter</span>
</a>
</div>
</div>

0 comments on commit d667879

Please sign in to comment.