Feature: Reverse proxy authentication (#455)

- Changes the auth settings to support more than two auth types
- Added a proxy auth type with settings for user and optionally group
headers
- Added a global middleware `proxy_auth_middleware` to handle proxy auth
(it does nothing if any other auth mode is set)
- Added support for proxy auth to `get_auth_mode`, `login_required`,
`api_login/out`, and `api_auth_check`
- Added a backend check to make protect the API for settings when admin
is required

---------

Co-authored-by: Joshua Tag Howard <git@jthoward.dev>
Co-authored-by: Alex <alex.bilbie1@gmail.com>
This commit is contained in:
Tag Howard
2026-01-15 13:27:50 +00:00
committed by GitHub
co-authored by Joshua Tag Howard Alex
parent 475ae420e5
commit 0d7a12ca7c
9 changed files with 1355 additions and 28 deletions
+5 -1
View File
@@ -83,7 +83,11 @@ export function useAuth(options: UseAuthOptions = {}): UseAuthReturn {
const handleLogout = useCallback(async () => {
try {
await logout();
const { logout_url } = await logout();
if (logout_url?.startsWith('https://') || logout_url?.startsWith('http://')) {
window.location.href = logout_url;
return;
}
setIsAuthenticated(false);
onLogoutSuccess?.();
navigate('/login', { replace: true });
+1
View File
@@ -181,6 +181,7 @@ export interface AuthResponse {
auth_required?: boolean;
is_admin?: boolean;
error?: string;
logout_url?: string;
}
// Type guard to check if a book is from a metadata provider