fix: lazy load login success component
This commit is contained in:
parent
8d4901601f
commit
6c025cc8d2
3 changed files with 3 additions and 4 deletions
|
@ -59,7 +59,7 @@ public class UserService {
|
||||||
HttpHeaders headers = new HttpHeaders();
|
HttpHeaders headers = new HttpHeaders();
|
||||||
headers.set("Authorization", token);
|
headers.set("Authorization", token);
|
||||||
ResponseEntity<KeycloakUserDto> response = this.http.exchange("http://localhost:9090/realms/LF12/protocol/openid-connect/userinfo", HttpMethod.GET, new HttpEntity<>(headers), KeycloakUserDto.class);
|
ResponseEntity<KeycloakUserDto> response = this.http.exchange("http://localhost:9090/realms/LF12/protocol/openid-connect/userinfo", HttpMethod.GET, new HttpEntity<>(headers), KeycloakUserDto.class);
|
||||||
|
|
||||||
return response.getBody();
|
return response.getBody();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@ import { Routes } from '@angular/router';
|
||||||
import { LandingComponent } from './feature/landing/landing.component';
|
import { LandingComponent } from './feature/landing/landing.component';
|
||||||
import { HomeComponent } from './feature/home/home.component';
|
import { HomeComponent } from './feature/home/home.component';
|
||||||
import { authGuard } from './auth.guard';
|
import { authGuard } from './auth.guard';
|
||||||
import { LoginSuccessComponent } from './feature/login-success/login-success.component';
|
|
||||||
|
|
||||||
export const routes: Routes = [
|
export const routes: Routes = [
|
||||||
{
|
{
|
||||||
|
@ -11,7 +10,7 @@ export const routes: Routes = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'login/success',
|
path: 'login/success',
|
||||||
component: LoginSuccessComponent,
|
loadComponent: () => import('./feature/login-success/login-success.component'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'home',
|
path: 'home',
|
||||||
|
|
|
@ -11,7 +11,7 @@ import { Router } from '@angular/router';
|
||||||
styleUrl: './login-success.component.css',
|
styleUrl: './login-success.component.css',
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
})
|
})
|
||||||
export class LoginSuccessComponent implements OnInit {
|
export default class LoginSuccessComponent implements OnInit {
|
||||||
private userService: UserService = inject(UserService);
|
private userService: UserService = inject(UserService);
|
||||||
private keycloakService: KeycloakService = inject(KeycloakService);
|
private keycloakService: KeycloakService = inject(KeycloakService);
|
||||||
private router: Router = inject(Router);
|
private router: Router = inject(Router);
|
||||||
|
|
Reference in a new issue