Improve user auth handling and download monitoring

Adds detection of local users for authentication validation and login, prevents role changes for OIDC users, and clarifies user management UI. Enhances active downloads API to include speed and ETA from qBittorrent, and improves file path handling in download monitoring. Also updates torrent tagging and user info returned by APIs.
This commit is contained in:
kikootwo
2025-12-23 13:38:13 -05:00
parent 174e9f05b6
commit bb42281dac
11 changed files with 169 additions and 40 deletions
+6
View File
@@ -15,6 +15,11 @@ export async function GET(request: NextRequest) {
const configs = await prisma.configuration.findMany();
const configMap = new Map(configs.map((c) => [c.key, c.value]));
// Check if any local users exist (for validation)
const hasLocalUsers = (await prisma.user.count({
where: { authProvider: 'local' }
})) > 0;
// Mask sensitive values
const maskValue = (key: string, value: string | null | undefined) => {
const sensitiveKeys = ['token', 'api_key', 'password', 'secret'];
@@ -27,6 +32,7 @@ export async function GET(request: NextRequest) {
// Build response object
const settings = {
backendMode: configMap.get('system.backend_mode') || 'plex',
hasLocalUsers,
plex: {
url: configMap.get('plex_url') || '',
token: maskValue('token', configMap.get('plex_token')),