OWM-API-Schlüssel explizit über aktive User-ID laden.

Wetter-Abruf nutzt getOwmApiKeyForActiveUser(), damit namespaced Keys nicht am fehlenden active_userid vorbeilaufen.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-31 12:14:43 +02:00
parent ae89b131a1
commit a6331bea1a
3 changed files with 27 additions and 3 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
import { apiFetch } from './api.js'
import { getOwmApiKey } from './userPreferences.js'
import { getOwmApiKeyForActiveUser } from './userPreferences.js'
export class WeatherApiError extends Error {
code: 'NO_KEY' | 'REQUEST_FAILED'
@@ -27,7 +27,7 @@ export async function fetchOpenWeatherCurrent(params: {
throw new WeatherApiError('lat/lon or location query required')
}
const userKey = getOwmApiKey().trim()
const userKey = getOwmApiKeyForActiveUser().trim()
const headers: Record<string, string> = {}
if (userKey) headers['X-OWM-Api-Key'] = userKey