Skip to content

Commit

Permalink
feat(client): Redirect to /client/commande from /auth when already au…
Browse files Browse the repository at this point in the history
…thenticated
  • Loading branch information
aripot007 committed Oct 14, 2024
1 parent ebd782a commit 8cf548c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions frontend/src/routes/auth/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,26 @@
import { api } from "$lib/config/config";
import { page } from '$app/stores';
import Error from "$lib/components/error.svelte";
import { onMount } from "svelte";
import { accountsApi } from '$lib/requests/requests';
import { goto } from "$app/navigation";
const noAccountError = $page.url.searchParams.has("noaccount")
// Skip auth if the user is already connected
onMount(() => {
accountsApi()
.getAccount({
withCredentials: true
})
.then(r => {
goto("/client/commande")
})
.catch(e => {
return () => {};
})
});
</script>

<style>
Expand Down

0 comments on commit 8cf548c

Please sign in to comment.