<script lang="ts">
    import { onMount} from 'svelte'

    onMount(() => {
        if (window.netlifyIdentity) {
            window.netlifyIdentity.on('init', (user) => {
                if (!user) {
                    window.netlifyIdentity.on('login', () => {
                        document.location.href = '/admin/';
                    });
                }
            });
        }
    })

</script>
