Logout not working with Netlify Auth Widget

For some reason, when the Netlify identity widget is used, I click logout and the netlify-cms-user is removed from Local Storage (for a moment) but then gets added back. Which leads to the widget showing over the posts, and if I close the widget I can still click around the CMS (I can’t do anything because I’m not actually logged in) - but the CMS thinks I’m logged in.

The logout does seem to briefly work for a millisecond. I don’t know why it then does the above.

I’ve followed the instructions here Add to Your Site | Netlify CMS | Open-Source Content Management System

A couple of things seem different - the login doesn’t redirect to the homepage. This isn’t an issue but could be why I’m experiencing the above issue on logout?

backend:
  name: git-gateway
  branch: main
publish_mode: editorial_workflow

I’ve created a public repo that shows this behaviour… GitHub - codemzy/netlify-cms-auth-test: Testing auth flow for netlify-cms just the basic set up for netlify-cms with identity and git-gateway.

You can see the behaviour here https://netlify-cms-logout.netlify.app/

Login with

cms@testing.com
testing

And then log out, you’ll see a flash of the page logged out and then the CMS loads again like you are still logged in, and the identity widget pops up. Netlify-cms thinks you are still logged in. You can close the identity widget and it appears like you are still logged in. If you click logout a second time then it works. But you have to log out twice each time!

Hi @codemzy,

It’s worth filing an issue on the CMS repo instead of posting about it here. Since you already have a reproduction, the contributors can test it and possible work on a fix.