style(user.service.ts): format code for clarity and consistency
All checks were successful
All checks were successful
This commit is contained in:
parent
e37dcecd3f
commit
47f4a4d558
1 changed files with 5 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue