Fixed authguard
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {ApplicationConfig, provideZoneChangeDetection} from '@angular/core';
|
||||
import {ApplicationConfig, inject, provideAppInitializer, provideZoneChangeDetection} from '@angular/core';
|
||||
import {provideRouter} from '@angular/router';
|
||||
|
||||
import {routes} from './app.routes';
|
||||
@@ -10,15 +10,21 @@ import {MAT_SNACK_BAR_DEFAULT_OPTIONS} from "@angular/material/snack-bar";
|
||||
import {AuthGuard} from "./authentication/authguard";
|
||||
import {TokenInterceptor} from "./authentication/tokenInterceptor";
|
||||
import {ErrorInterceptor} from "./authentication/errorInterceptor";
|
||||
import {provideEnvironmentNgxMask, provideNgxMask} from "ngx-mask";
|
||||
import {provideNgxMask} from "ngx-mask";
|
||||
import {UserService} from './authentication/user.service';
|
||||
import {provideAnimations} from "@angular/platform-browser/animations";
|
||||
|
||||
export const appConfig: ApplicationConfig = {
|
||||
providers: [
|
||||
provideAppInitializer(() => {
|
||||
const userService = inject(UserService);
|
||||
userService.initializeUser();
|
||||
}),
|
||||
provideZoneChangeDetection({eventCoalescing: true}),
|
||||
provideRouter(routes),
|
||||
provideClientHydration(),
|
||||
provideHttpClient(withFetch(), withInterceptorsFromDi()),
|
||||
provideAnimationsAsync(),
|
||||
provideAnimations(),
|
||||
provideMomentDateAdapter(undefined, {useUtc: false}),
|
||||
{ provide: MAT_SNACK_BAR_DEFAULT_OPTIONS, useValue: { duration: 2500}},
|
||||
AuthGuard,
|
||||
@@ -27,3 +33,4 @@ export const appConfig: ApplicationConfig = {
|
||||
provideNgxMask(),
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user