126. Configure Guard (#15)
This commit is contained in:
@ -6,6 +6,7 @@ import {HTTP_INTERCEPTORS, HttpClientModule} from "@angular/common/http";
|
|||||||
import {AuthenticationService} from "./service/authentication.service";
|
import {AuthenticationService} from "./service/authentication.service";
|
||||||
import {UserService} from "./service/user.service";
|
import {UserService} from "./service/user.service";
|
||||||
import {AuthInterceptor} from "./interceptor/auth.interceptor";
|
import {AuthInterceptor} from "./interceptor/auth.interceptor";
|
||||||
|
import {AuthenticationGuard} from "./guard/authentication.guard";
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
@ -15,7 +16,7 @@ import {AuthInterceptor} from "./interceptor/auth.interceptor";
|
|||||||
BrowserModule,
|
BrowserModule,
|
||||||
HttpClientModule
|
HttpClientModule
|
||||||
],
|
],
|
||||||
providers: [AuthenticationService, UserService,
|
providers: [AuthenticationGuard, AuthenticationService, UserService,
|
||||||
{provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true}
|
{provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true}
|
||||||
],
|
],
|
||||||
bootstrap: [AppComponent]
|
bootstrap: [AppComponent]
|
||||||
|
|||||||
Reference in New Issue
Block a user