sveltia / sveltia-cms

Alternative to Netlify/Decap CMS. Fast, lightweight, Git-based headless CMS. Modern UX, first-class i18n support, open source & free. Made with Svelte.
MIT License
727 stars 33 forks source link

CMS on mount, not respecting localstorage #145

Closed jamieRowen-mediacom closed 1 month ago

jamieRowen-mediacom commented 1 month ago

I will preface this with I am not a front end dev by any means, so if this question is silly please let me know and apologies.

If I look at https://github.com/sveltia/sveltia-cms/blob/main/src/lib/services/user.js#L68 and https://github.com/sveltia/sveltia-cms/blob/c007deb89cb68d71198b1e3d05f55adc268c3370/src/lib/components/entrance/sign-in.svelte#L16 my, possibly naive, expectation would be that if "decap-cms-user" is in localStorage that would be picked up and login would be automatic but I don't find this to be the case.

Am I misunderstanding something here?

Attached is screen shot of local storage and login page

sveltia
jamieRowen-mediacom commented 1 month ago

my apologies, this was my error. Somehow the token in the local storage had been removed and I hadn't seen that.

kyoshino commented 1 month ago

No worries! Sveltia CMS picks up decap-cms-user but a token is required to sign in.

And oh, it seems you’re using a local server. Then you can work with a local repository by opening http://localhost:4321 instead of http://127.0.0.1:4321.

jamieRowen-mediacom commented 1 month ago

No worries! Sveltia CMS picks up decap-cms-user but a token is required to sign in.

And oh, it seems you’re using a local server. Then you can work with a local repository by opening http://localhost:4321 instead of http://127.0.0.1:4321.

thanks for the quick response. I can get the login sorted by re-instating the token.

I am aware of the local host and local repo option, thank you however, my use case is such that I don't want to run against the local copy of the repo, I want to roll the CMS into another tool for my users who may run locally, but have a choice of repos that they want to interact with.