stable after blogs
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import {Component, OnDestroy, OnInit} from '@angular/core';
|
||||
import {Router} from "@angular/router";
|
||||
import {AuthenticationService} from "../../service/authentication.service";
|
||||
|
||||
import {NotificationService} from "../../service/notification.service";
|
||||
import {NotificationType} from "../../notification/notification-type";
|
||||
import {Subscription} from "rxjs";
|
||||
@ -8,6 +8,8 @@ import {UserLogin} from "../../dto/user-login";
|
||||
import {HttpErrorResponse, HttpResponse} from "@angular/common/http";
|
||||
import {User} from "../../model/user";
|
||||
import {HeaderType} from "../../enum/header-type.enum";
|
||||
import { AuthenticationService } from 'src/app/service/authentication.service';
|
||||
;
|
||||
|
||||
@Component({
|
||||
selector: 'app-login',
|
||||
@ -26,7 +28,8 @@ export class LoginComponent implements OnInit, OnDestroy {
|
||||
|
||||
ngOnInit(): void {
|
||||
if (this.authenticationService.isUserLoggedIn()) {
|
||||
this.router.navigate(["/management", "users"]);
|
||||
this.router.navigate(["/user", "management"]);
|
||||
// this.router.navigate(["/management", "users"]);
|
||||
this.notificationService.notify(NotificationType.INFO, "You are already logged in");
|
||||
}
|
||||
}
|
||||
@ -43,7 +46,8 @@ export class LoginComponent implements OnInit, OnDestroy {
|
||||
|
||||
this.authenticationService.addUserToLocalStorage(response.body!);
|
||||
|
||||
this.router.navigateByUrl('/management/users');
|
||||
this.router.navigateByUrl('/home');
|
||||
// this.router.navigateByUrl('/management/users');
|
||||
this.showLoading = false;
|
||||
},
|
||||
(errorResponse: HttpErrorResponse) => {
|
||||
|
||||
Reference in New Issue
Block a user