fix(secu): don't store komga pwd but authstring
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -18,7 +18,6 @@ export default async function SettingsPage() {
|
||||
config = {
|
||||
url: mongoConfig.url,
|
||||
username: mongoConfig.username,
|
||||
password: mongoConfig.password,
|
||||
userId: mongoConfig.userId,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user