bundle size
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { BehaviorSubject, Observable, tap, of, catchError } from 'rxjs';
|
||||
import { IUser } from '../../model/interface/user.interface';
|
||||
import { environment } from '../../../environments/environment.development';
|
||||
import { HotToastService } from '@ngxpert/hot-toast';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -13,7 +14,8 @@ export class AuthService {
|
||||
private accessTokenSubject = new BehaviorSubject<string | null>(null);
|
||||
private refreshToken: string | null = null;
|
||||
private http: HttpClient = inject(HttpClient);
|
||||
private route: ActivatedRoute = inject(ActivatedRoute);
|
||||
private router: Router = inject(Router);
|
||||
private toast: HotToastService = inject(HotToastService);
|
||||
|
||||
private user: IUser | null = null;
|
||||
|
||||
@@ -99,6 +101,8 @@ export class AuthService {
|
||||
this.refreshToken = null;
|
||||
localStorage.removeItem('accessToken_vault');
|
||||
localStorage.removeItem('refreshToken_vault');
|
||||
this.router.navigateByUrl('/login');
|
||||
this.toast.show('Du wurdest ausgeloggt.')
|
||||
}
|
||||
|
||||
public routeToLogin() {
|
||||
|
||||
Reference in New Issue
Block a user