🔧 Fix settings API: Use public endpoint for logged-in users

- Changed from /api/v1/private/update-player-settings to /api/v1/public/update-player-settings
- Removed API key requirement for logged-in users
- Added both public and private endpoints for flexibility
- Fixed 401 Unauthorized error in settings modal
This commit is contained in:
2025-09-08 19:16:57 +02:00
parent 70ceb2da25
commit fbd8677709
2 changed files with 567 additions and 524 deletions

View File

@@ -984,12 +984,11 @@ async function saveSettings() {
const showInLeaderboard = document.getElementById('showInLeaderboard').checked;
// Update player settings
const response = await fetch(`/api/v1/private/update-player-settings`, {
// Update player settings using public endpoint (no API key needed)
const response = await fetch(`/api/v1/public/update-player-settings`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${localStorage.getItem('apiKey')}`
'Content-Type': 'application/json'
},
body: JSON.stringify({
player_id: currentPlayerId,

File diff suppressed because it is too large Load Diff