sveltia-cms: PKCE authentication: content is not loaded and no error at all
Using GitLab, with a private repository and CSP rules.
I’ve just configured PKCE authentication following Decap CMS’ docs on it. First, I’ve got CSP errors due to two configurations not mentioned in Sveltia docs:
connect-src https://status-api.hostedstatus.com
script-src 'unsafe-inline'
After adding them, I’m able to log in with GitLab, but collections’ content is not loaded (just the configuration for the collections, populating the left sidebar) and there’s no error in browser console.
The CMS works flawlessly when loaded with a local repository.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 19 (11 by maintainers)
Commits related to this issue
- Work around GitLab’s limit of 100 records per query Fix https://github.com/sveltia/sveltia-cms/issues/136 — committed to front-matter/sveltia-cms by kyoshino 3 years ago
I know Static CMS but haven’t tried it myself yet. It’s a community maintenance fork of Netlify CMS. Just like Sveltia CMS, it was started before Decap CMS was announced. For some reason, they have dropped the GraphQL support and the bundle size is pretty huge (2.5 MB), so I guessed the performance wasn’t great. They have better documentation than Netlify/Decap CMS though.
Sooner or later I’ll start working on Static CMS compatibility, including the Key Value widget, which effectively solves https://github.com/decaporg/decap-cms/issues/5489 🙂
Yes, and also much faster than Static CMS (which uses React as well).
No worries! Glad it works for you now! 👏🏼
I forgot to mention that since GitLab only allows to retrieve 100 records (files) at once, loading the site data is slower than GitHub that doesn’t have such a limit. I think Sveltia CMS is overall still faster than Netlify/Decap CMS 😄
The fix shipped with v0.26.4! Can you please delete the local data base and try again? In Chrome, open DevTools, select the Application tab, select your repository name under IndxededDB, and Click Delete database. Then reload the page.
@kyoshino done, you’re now Reporter
No, just a standard private gitlab.com repository.
Also, I’ve tested this in Firefox (125) and Chrome (123), with pretty much the same results, except in Chrome there’s a “problems” message about discontinued use of
StorageType.persistentwhennavigator.storageshould be used instead. My site is builded by Hugo and hosted on Netlify. My GitLab account is protected by 2FA.Below is the backend part of my configuration:
In the first time I log in, after clicking “Authorize” in the screen below, the popup returns to the Sveltia login screen with the button “Sign In with GitLab”. I then close the popup, and click “Sign In with GitLab” in the main window (which is also on the login screen). Then the screen below appears again, I click “Authorize” and then I log in, at the first collection but without any content. Everytime I log in, the screen below appears. Perhaps it’s related, maybe the authentication is not being persisted?
I don’t know if it’s something related, but since the very first time I’ve used a static CMS (Netlify CMS at that time), I had to duplicate
config.yamlboth instatic/andstatic/admin/, I don’t know why. When I use Sveltia locally, it correctly reads fromstatic/admin/config.yaml, but when on web it reads fromstatic/config.yaml.