fix(secu): don't store komga pwd but authstring

This commit is contained in:
Julien Froidefond
2025-02-24 08:28:43 +01:00
parent 738abe3b9d
commit 980a6daca2
7 changed files with 17 additions and 26 deletions

View File

@@ -1,17 +1,16 @@
import { NextResponse } from "next/server";
import { TestService } from "@/lib/services/test.service";
import { AuthConfig } from "@/types/auth";
import { ConfigDBService } from "@/lib/services/config-db.service";
export async function POST(request: Request) {
export async function POST() {
try {
const { serverUrl, username, password } = await request.json();
const config = await ConfigDBService.getConfig();
const config: AuthConfig = {
serverUrl,
credentials: { username, password },
};
const { libraries } = await TestService.testConnection({
serverUrl: config.url,
authHeader: config.authHeader,
});
const { libraries } = await TestService.testConnection(config);
return NextResponse.json({
message: "Connexion réussie",
librariesCount: libraries.length,

View File

@@ -18,7 +18,6 @@ export default async function SettingsPage() {
config = {
url: mongoConfig.url,
username: mongoConfig.username,
password: mongoConfig.password,
userId: mongoConfig.userId,
};
}