Add PKCE support in config.yml and enhance DecapCMS initialization in index.html with additional load checks and debugging logs.

This commit is contained in:
2025-07-29 14:00:00 -08:00
parent 03e3c5aef9
commit a54f95baf5
2 changed files with 6 additions and 1 deletions

View File

@@ -6,8 +6,9 @@ backend:
base_url: https://git.beardedtek.com base_url: https://git.beardedtek.com
api_root: https://git.beardedtek.com/api/v1 api_root: https://git.beardedtek.com/api/v1
auth_endpoint: https://git.beardedtek.com/login/oauth/authorize auth_endpoint: https://git.beardedtek.com/login/oauth/authorize
# Add explicit token endpoint for better compatibility
token_endpoint: https://git.beardedtek.com/login/oauth/access_token token_endpoint: https://git.beardedtek.com/login/oauth/access_token
# Add debugging and ensure PKCE is properly configured
auth_flow: pkce
commit_messages: commit_messages:
create: 'content: create {{collection}} "{{slug}}"' create: 'content: create {{collection}} "{{slug}}"'
update: 'content: update {{collection}} "{{slug}}"' update: 'content: update {{collection}} "{{slug}}"'

View File

@@ -12,12 +12,16 @@
<script> <script>
// Wait for the script to load before initializing // Wait for the script to load before initializing
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
console.log('DOM loaded, checking for DecapCMS...');
if (typeof DecapCMS !== 'undefined') { if (typeof DecapCMS !== 'undefined') {
console.log('DecapCMS found, initializing...');
DecapCMS.init({ config: '/admin/config.yml' }); DecapCMS.init({ config: '/admin/config.yml' });
} else { } else {
console.log('DecapCMS not found, waiting...');
// Fallback: wait a bit more for the script to load // Fallback: wait a bit more for the script to load
setTimeout(function() { setTimeout(function() {
if (typeof DecapCMS !== 'undefined') { if (typeof DecapCMS !== 'undefined') {
console.log('DecapCMS found after timeout, initializing...');
DecapCMS.init({ config: '/admin/config.yml' }); DecapCMS.init({ config: '/admin/config.yml' });
} else { } else {
console.error('DecapCMS failed to load'); console.error('DecapCMS failed to load');