vor ähnlichkeitsprüfung
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
(() => {
|
||||
const API_URL = 'https://fb.srv.medeba-media.de/api';
|
||||
const LOGIN_PAGE = 'login.html';
|
||||
|
||||
let posts = [];
|
||||
let filteredPosts = [];
|
||||
@@ -9,6 +10,18 @@ let currentProfileFilter = 'all';
|
||||
const DAY_IN_MS = 24 * 60 * 60 * 1000;
|
||||
const HOUR_IN_MS = 60 * 60 * 1000;
|
||||
|
||||
function handleUnauthorized(response) {
|
||||
if (response && response.status === 401) {
|
||||
if (typeof redirectToLogin === 'function') {
|
||||
redirectToLogin();
|
||||
} else {
|
||||
window.location.href = LOGIN_PAGE;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function startOfDay(date) {
|
||||
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user