Add app auth, dashboard, scheduler, video management, and new scrapers
- JWT-based app authentication with user roles, folder/route access control - Dashboard with storage stats, health checks, and recent activity - Auto-download/scrape scheduler (12h interval) with per-user and per-job configs - Video upload, tagging, HLS transcoding, and detail pages - New scrapers: LeakGallery, Mega (megajs), yt-dlp - FlareSolverr integration for Cloudflare-protected sites - Gallery: advanced filtering (date, size, search), sort modes, equal-mix shuffle - Forum sites management with stored cookies/auth - GridWall/GridCell components for responsive media grid - Media API with folder-access permissions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -55,6 +55,23 @@ async function proxyGet(ofPath, authConfig) {
|
||||
return { status: res.status, data };
|
||||
}
|
||||
|
||||
// GET /api/auth/check — validate auth by calling OF API
|
||||
router.get('/api/auth/check', async (req, res) => {
|
||||
try {
|
||||
const authConfig = getAuthConfig();
|
||||
if (!authConfig) {
|
||||
return res.json({ valid: false, error: 'No auth configured' });
|
||||
}
|
||||
const { status, data } = await proxyGet('/api2/v2/users/me', authConfig);
|
||||
if (status === 200 && data && data.id) {
|
||||
return res.json({ valid: true, user: { id: data.id, name: data.name, username: data.username } });
|
||||
}
|
||||
return res.json({ valid: false, error: data?.error?.message || data?.message || `HTTP ${status}` });
|
||||
} catch (err) {
|
||||
return res.json({ valid: false, error: err.message });
|
||||
}
|
||||
});
|
||||
|
||||
// GET /api/auth
|
||||
router.get('/api/auth', (req, res) => {
|
||||
const config = getAuthConfig();
|
||||
|
||||
Reference in New Issue
Block a user