Hello,
I am creating a login button and using netlify API for my github pages site but it doesn’t work. I get “Failed to load settings from /.netlify/identity”
What am I doing wrong? Inside my head I have:
Here is my js for the button :
if (window.netlifyIdentity) { window.netlifyIdentity.init({ APIConfig: { api_url: 'https://annarichman.netlify.app/.netlify/identity' } }); } // 2. Logic for when Anna logs in window.netlifyIdentity.on("login", user => { window.netlifyIdentity.close(); // Redirect to the admin dashboard window.location.href = "/admin/"; }); // 3. Make the button work const loginBtn = document.querySelector('.login-btn'); if (loginBtn) { loginBtn.addEventListener('click', () => { window.netlifyIdentity.open(); }); } What am I doing wrong? I have the github stuff right on the netlify settings too I think....I did all the Oauth stuff...