feat: add authentik for authentication #58

Merged
jank merged 23 commits from feature/authentik into main 2025-04-04 13:26:03 +00:00
Showing only changes of commit 47f4a4d558 - Show all commits

View file

@ -48,12 +48,12 @@ export class UserService {
// Authentik format might differ from Keycloak
// Check different possible locations for the ID and username
const info = profile['info'] as Record<string, unknown> | undefined;
const id = info?.['sub'] as string || profile['sub'] as string;
const id = (info?.['sub'] as string) || (profile['sub'] as string);
const username =
info?.['preferred_username'] as string ||
profile['preferred_username'] as string ||
profile['email'] as string ||
profile['name'] as string;
(info?.['preferred_username'] as string) ||
(profile['preferred_username'] as string) ||
(profile['email'] as string) ||
(profile['name'] as string);
if (!id || !username) {
console.error('Could not extract user ID or username from profile', profile);