style: Fix formatting and spacing in multiple files
Some checks failed
CI / Get Changed Files (pull_request) Successful in 7s
CI / prettier (pull_request) Successful in 22s
CI / Checkstyle Main (pull_request) Successful in 53s
CI / eslint (pull_request) Failing after 1m8s
CI / test-build (pull_request) Successful in 1m35s

This commit is contained in:
Jan K9f 2025-04-02 16:11:53 +02:00
commit 617654caeb
Signed by: jank
GPG key ID: B9F475106B20F144
5 changed files with 102 additions and 82 deletions

View file

@ -35,10 +35,12 @@ export class UserService {
}
public createUser(id: string, username: string): Observable<User> {
return this.http.post<User>('/backend/user', {
authentikId: id,
username: username,
}).pipe(tap((user) => this.currentUserSubject.next(user)));
return this.http
.post<User>('/backend/user', {
authentikId: id,
username: username,
})
.pipe(tap((user) => this.currentUserSubject.next(user)));
}
public getOrCreateUser(profile: any): Observable<User> {
@ -46,7 +48,11 @@ export class UserService {
// Authentik format might differ from Keycloak
// Check different possible locations for the ID and username
const id = profile.info?.sub || profile['sub'];
const username = profile.info?.preferred_username || profile['preferred_username'] || profile['email'] || profile['name'];
const username =
profile.info?.preferred_username ||
profile['preferred_username'] ||
profile['email'] ||
profile['name'];
if (!id || !username) {
console.error('Could not extract user ID or username from profile', profile);