126. Configure Guard (#15)

This commit is contained in:
Art
2021-09-17 10:06:57 +03:00
parent 2fb286ac00
commit 7aedfe5ea7

View File

@ -6,6 +6,7 @@ import {HTTP_INTERCEPTORS, HttpClientModule} from "@angular/common/http";
import {AuthenticationService} from "./service/authentication.service";
import {UserService} from "./service/user.service";
import {AuthInterceptor} from "./interceptor/auth.interceptor";
import {AuthenticationGuard} from "./guard/authentication.guard";
@NgModule({
declarations: [
@ -15,7 +16,7 @@ import {AuthInterceptor} from "./interceptor/auth.interceptor";
BrowserModule,
HttpClientModule
],
providers: [AuthenticationService, UserService,
providers: [AuthenticationGuard, AuthenticationService, UserService,
{provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true}
],
bootstrap: [AppComponent]