fix: 500 when loggin in
This commit is contained in:
parent
5afdbad461
commit
a091387c1c
@ -11,7 +11,7 @@ public class UserMappingService {
|
||||
}
|
||||
|
||||
public UserEntity mapToUserEntity(CreateUserDto createUserDto) {
|
||||
return new UserEntity(createUserDto.getUsername(), createUserDto.getKeycloakId(), 0);
|
||||
return new UserEntity(createUserDto.getKeycloakId(), createUserDto.getUsername(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { KeycloakProfile } from 'keycloak-js';
|
||||
import { Observable } from 'rxjs';
|
||||
import { catchError, EMPTY, Observable } from 'rxjs';
|
||||
import { User } from '../model/User';
|
||||
|
||||
@Injectable({
|
||||
@ -11,7 +11,7 @@ export class UserService {
|
||||
private http: HttpClient = inject(HttpClient);
|
||||
|
||||
public getUser(id: string): Observable<User | null> {
|
||||
return this.http.get<User | null>(`/backend/user/${id}`);
|
||||
return this.http.get<User | null>(`/backend/user/${id}`).pipe(catchError(() => EMPTY));
|
||||
}
|
||||
|
||||
public createUser(id: string, username: string): Observable<User> {
|
||||
|
@ -18,7 +18,7 @@ export class NavbarComponent {
|
||||
login() {
|
||||
try {
|
||||
const baseUrl = window.location.origin;
|
||||
this.keycloakService.login({ redirectUri: `${baseUrl}/home` });
|
||||
this.keycloakService.login({ redirectUri: `${baseUrl}/login/success` });
|
||||
} catch (error) {
|
||||
console.error('Login failed:', error);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user