refactor: update imports and type definitions in services
Some checks failed
CI / Get Changed Files (pull_request) Successful in 7s
CI / eslint (pull_request) Successful in 26s
CI / test-build (pull_request) Successful in 31s
CI / prettier (pull_request) Failing after 54s
CI / Checkstyle Main (pull_request) Successful in 1m57s

This commit is contained in:
Jan K9f 2025-04-02 16:20:37 +02:00
commit e37dcecd3f
Signed by: jank
GPG key ID: B9F475106B20F144
4 changed files with 12 additions and 10 deletions

View file

@ -47,12 +47,13 @@ export class UserService {
console.log('Full authentik profile:', profile);
// Authentik format might differ from Keycloak
// Check different possible locations for the ID and username
const id = profile.info?.sub || profile['sub'];
const info = profile['info'] as Record<string, unknown> | undefined;
const id = info?.['sub'] as string || profile['sub'] as string;
const username =
profile.info?.preferred_username ||
profile['preferred_username'] ||
profile['email'] ||
profile['name'];
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);