vor ähnlichkeitsprüfung

This commit is contained in:
2025-12-21 14:21:55 +01:00
parent ffcfce2b31
commit fde5ab91c8
14 changed files with 721 additions and 50 deletions

View File

@@ -1,5 +1,6 @@
(() => {
const API_URL = 'https://fb.srv.medeba-media.de/api';
const LOGIN_PAGE = 'login.html';
const PROVIDER_MODELS = {
gemini: [
@@ -72,8 +73,25 @@ let moderationSettings = {
sports_auto_hide_enabled: false
};
function handleUnauthorized(response) {
if (response && response.status === 401) {
if (typeof redirectToLogin === 'function') {
redirectToLogin();
} else {
window.location.href = LOGIN_PAGE;
}
return true;
}
return false;
}
function apiFetch(url, options = {}) {
return fetch(url, {...options, credentials: 'include'});
return fetch(url, {...options, credentials: 'include'}).then((response) => {
if (handleUnauthorized(response)) {
throw new Error('Nicht angemeldet');
}
return response;
});
}
function showToast(message, type = 'info') {