style: Fix formatting and spacing in multiple files
Some checks failed
Some checks failed
This commit is contained in:
parent
fa09a8533f
commit
617654caeb
5 changed files with 102 additions and 82 deletions
|
@ -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);
|
||||
|
|
Reference in a new issue