57 lines
1.2 KiB
TypeScript
57 lines
1.2 KiB
TypeScript
import { URLS } from '@/lib/config/constants';
|
|
|
|
export interface AutheliaUser {
|
|
name: string;
|
|
email: string;
|
|
groups: string[];
|
|
avatar?: string;
|
|
}
|
|
|
|
export interface AuthStatus {
|
|
isAuthenticated: boolean;
|
|
user?: AutheliaUser;
|
|
}
|
|
|
|
class AuthService {
|
|
// Keep the constant in case other code expects it, but we no longer call it
|
|
private authBaseUrl = URLS?.services?.auth ?? '';
|
|
|
|
/**
|
|
* Authelia integration intentionally disabled.
|
|
* Return unauthenticated status to remove external links while preserving API.
|
|
*/
|
|
async checkAuthStatus(): Promise<AuthStatus> {
|
|
return { isAuthenticated: false };
|
|
}
|
|
|
|
/**
|
|
* No user info available when Authelia is disabled.
|
|
*/
|
|
async getUserInfo(): Promise<AutheliaUser | undefined> {
|
|
return undefined;
|
|
}
|
|
|
|
private generateAvatarUrl(_identifier: string): string {
|
|
return '';
|
|
}
|
|
|
|
private simpleHash(_str: string): string {
|
|
return '';
|
|
}
|
|
|
|
/**
|
|
* Disabled: do nothing instead of redirecting to an external auth provider.
|
|
*/
|
|
login(): void {
|
|
return;
|
|
}
|
|
|
|
/**
|
|
* Disabled: no-op logout.
|
|
*/
|
|
async logout(): Promise<void> {
|
|
return;
|
|
}
|
|
}
|
|
|
|
export const authService = new AuthService(); |