feat: fix auth, provider health checks, search, and redesign UI
- Fix register/login: dict-style access on UserTable ORM objects - Fix HTMX auth: inject JWT token in all HTMX request headers - Fix FS7 search: use DLE AJAX endpoint /engine/ajax/search.php - Fix ZT search: use ?p=series&search=QUERY (not DLE format) - Fix provider health: load hardcoded providers + domain manager - Add self.id to all anime/series providers - Redesign homepage: Netflix-style horizontal scroll cards (.hc) - Redesign search results: grouped by title, poster + synopsis + 3 buttons - Add Télécharger dropdown: season download + episode picker - Fix navbar CSS: restore .tabs flex layout, remove orphan rules - Fix HTMX spinner: remove inline display:none, use CSS indicator - Add AGENTS.md files across project for developer documentation
This commit is contained in:
+3
-6
@@ -41,11 +41,10 @@ function removeToken() {
|
||||
|
||||
// Check if user is authenticated
|
||||
async function checkAuth() {
|
||||
console.log('Checking authentication...');
|
||||
const token = getToken();
|
||||
|
||||
if (!token) {
|
||||
console.log('No token found');
|
||||
window.dispatchEvent(new CustomEvent('auth-logout'));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -56,20 +55,18 @@ async function checkAuth() {
|
||||
|
||||
if (response.ok) {
|
||||
const data = await response.json();
|
||||
console.log('Auth success:', data.user.username);
|
||||
|
||||
// Dispatch for Alpine
|
||||
window.dispatchEvent(new CustomEvent('auth-success', {
|
||||
detail: { username: data.user.full_name || data.user.username }
|
||||
}));
|
||||
|
||||
return true;
|
||||
} else {
|
||||
console.log('Token invalid');
|
||||
removeToken();
|
||||
window.dispatchEvent(new CustomEvent('auth-logout'));
|
||||
return false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Auth check error:', error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user