Skip to content

Commit

Permalink
fix(comptoir): bouton déconnexion
Browse files Browse the repository at this point in the history
  • Loading branch information
yyewolf committed Dec 5, 2023
1 parent 39d2e6c commit aa64435
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion frontend/src/routes/comptoir/c/transactions/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import { open_caisse, open_door, open_ventilo } from '$lib/local/local';
import NewRefill from '$lib/components/comptoir/newRefill.svelte';
import Refills from '$lib/components/comptoir/refills.svelte';
import { authApi } from '$lib/requests/requests';
function reset() {
askForCard = false;
Expand All @@ -25,6 +26,20 @@
function close() {
newRefill = false;
}
function logoutAccount() {
authApi()
.logout({
withCredentials: true
})
.then(() => {
goto('/comptoir');
})
.catch(() => {
goto('/comptoir');
});
}
</script>

{#if askForCard}
Expand Down Expand Up @@ -110,7 +125,7 @@
<!-- disconnection button -->
<button
class="text-3xl bg-blue-700 p-2 rounded-xl hover:bg-blue-900 transition-all"
on:click={() => goto('/comptoir')}
on:click={() => logoutAccount()}
>
Deconnexion
</button>
Expand Down

0 comments on commit aa64435

Please sign in to comment.