mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-03 04:40:09 +00:00
Add backend unit test framework and modularize settings UI
Introduced a Vitest-based backend unit testing framework with supporting scripts, helpers, and GitHub Actions integration. Refactored the admin settings page to a modular architecture, splitting monolithic logic into feature-specific tabs and hooks for improved maintainability and testability. Updated documentation to reflect the new testing setup and settings architecture, and added new dependencies for testing utilities.
This commit is contained in:
@@ -191,9 +191,10 @@ async function authenticatedHandler(req: AuthenticatedRequest) {
|
||||
if (!response.ok) {
|
||||
const errorText = await response.text();
|
||||
logger.error('Custom provider connection error', { error: errorText });
|
||||
// Return 400 (not the external service's status) to prevent triggering logout on 401
|
||||
return NextResponse.json(
|
||||
{ error: `Failed to connect to custom provider: ${response.status} ${errorText}` },
|
||||
{ status: response.status }
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
|
||||
@@ -382,9 +383,10 @@ async function unauthenticatedHandler(req: NextRequest) {
|
||||
if (!response.ok) {
|
||||
const errorText = await response.text();
|
||||
logger.error('Custom provider connection error', { error: errorText });
|
||||
// Return 400 (not the external service's status) to prevent triggering logout on 401
|
||||
return NextResponse.json(
|
||||
{ error: `Failed to connect to custom provider: ${response.status} ${errorText}` },
|
||||
{ status: response.status }
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user