danurbanowicz / eleventy-netlify-boilerplate

A template for building a blog with the Eleventy static site generator and Decap CMS

Home Page:https://eleventy-netlify-boilerplate.netlify.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Auto-redirect doesn't work

PierW opened this issue · comments

On production (netlify) there is a problem with the redirect after the login in admin area.
I tried to insert this in homepage... it's works fine but just on local:
<script> if (window.netlifyIdentity) { window.netlifyIdentity.on("init", user => { if (!user) { window.netlifyIdentity.on("login", () => { document.location.href = "/admin/"; }); } }); } </script>

in production I still have to press the button: "Login with Netlify Identity"

Hi, this is indeed annoying and I think it may be related to an issue with gotrue-js not updating the user token on first load.

netlify/gotrue-js#71

Add to that the various UX concerns with the Netlify Identity Widget, I'm not sure what we can do to fix it right now.

Correct me if I'm misunderstanding your issue.