Ottimizzazione UI player, rotazione head tilt invertita, prefisso playlist in Home e implementazione Identity QR modal e interceptor API

This commit is contained in:
David Frassi
2026-06-12 17:13:46 +02:00
parent 4d1883a45d
commit d023bb7d3f
31 changed files with 1706 additions and 160 deletions
+22
View File
@@ -8,5 +8,27 @@ if (environment.production) {
enableProdMode();
}
// Patch window.fetch to automatically inject basic auth header for api.canticristiani.it
const originalFetch = window.fetch;
window.fetch = function(input: RequestInfo | URL, init?: RequestInit) {
const url = typeof input === 'string' ? input : (input instanceof URL ? input.href : input.url);
if (url.includes('api.canticristiani.it')) {
init = init || {};
init.headers = init.headers || {};
const authHeader = 'Basic ' + btoa(`${environment.apiAuthUser}:${environment.apiAuthPass}`);
if (init.headers instanceof Headers) {
init.headers.set('Authorization', authHeader);
} else if (Array.isArray(init.headers)) {
const hasAuth = init.headers.some(([key]) => key.toLowerCase() === 'authorization');
if (!hasAuth) {
init.headers.push(['Authorization', authHeader]);
}
} else {
(init.headers as Record<string, string>)['Authorization'] = authHeader;
}
}
return originalFetch(input, init);
};
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.log(err));