Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 576d9f7a7b | |||
| af93daeddc |
@@ -1 +1 @@
|
|||||||
v1.4.9
|
v1.4.10
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "aniworld-web",
|
"name": "aniworld-web",
|
||||||
"version": "1.4.9",
|
"version": "1.4.10",
|
||||||
"description": "Aniworld Anime Download Manager - Web Frontend",
|
"description": "Aniworld Anime Download Manager - Web Frontend",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ class SetupRedirectMiddleware(BaseHTTPMiddleware):
|
|||||||
"/login", # Login page (needs to be accessible after setup)
|
"/login", # Login page (needs to be accessible after setup)
|
||||||
"/queue", # Queue page (for initial load)
|
"/queue", # Queue page (for initial load)
|
||||||
"/api/auth/", # All auth endpoints (setup, login, logout, register)
|
"/api/auth/", # All auth endpoints (setup, login, logout, register)
|
||||||
|
"/api/setup/", # Setup API (unresolved folders, etc.)
|
||||||
"/ws/connect", # WebSocket connection (needed for loading page)
|
"/ws/connect", # WebSocket connection (needed for loading page)
|
||||||
"/api/queue/", # Queue API endpoints
|
"/api/queue/", # Queue API endpoints
|
||||||
"/api/downloads/", # Download API endpoints
|
"/api/downloads/", # Download API endpoints
|
||||||
|
|||||||
@@ -443,15 +443,13 @@
|
|||||||
|
|
||||||
// API client helpers
|
// API client helpers
|
||||||
async function fetchUnresolved() {
|
async function fetchUnresolved() {
|
||||||
|
// Note: /api/setup/unresolved does not require auth
|
||||||
|
// It's accessible during the initial setup flow
|
||||||
const token = localStorage.getItem('auth_token');
|
const token = localStorage.getItem('auth_token');
|
||||||
if (!token) {
|
const headers = token ? { 'Authorization': `Bearer ${token}` } : {};
|
||||||
window.location.href = '/login';
|
const res = await fetch('/api/setup/unresolved', { headers });
|
||||||
return null;
|
|
||||||
}
|
|
||||||
const res = await fetch('/api/setup/unresolved', {
|
|
||||||
headers: { 'Authorization': `Bearer ${token}` }
|
|
||||||
});
|
|
||||||
if (res.status === 401) {
|
if (res.status === 401) {
|
||||||
|
// Redirect to login only if we had a token but it expired
|
||||||
localStorage.removeItem('auth_token');
|
localStorage.removeItem('auth_token');
|
||||||
window.location.href = '/login';
|
window.location.href = '/login';
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user