I need to put those line into my code. but this error keeps appearing and I'm stuck with this, being not able to find the solution. Please help me.
Type '{ tokenGetter: () => string; whitelistedDomains: string[]; blacklistedRoutes: undefined[]; }' is not assignable to type 'JwtConfig'. Object literal may only specify known properties, and 'whitelistedDomains' does not exist in type 'JwtConfig'.ts(2322) angular-jwt.module.d.ts(14, 5): The expected type comes from property 'config' which is declared here on type 'JwtModuleOptions'
underlined error occurs at whitelistedDomains
app.module.ts
imports: [
BrowserModule,
NgbModule,
.
.
AppRoutingModule,
JwtModule.forRoot({
config:{
tokenGetter:() => {
return localStorage.getItem('access_token');
},
whitelistedDomains: ['localhost:8080'],
blacklistedRoutes:[]
}
})
],
If you look at the JwtConfig
interface, the whitelistedDomains
and blacklistedRoutes
properties are not to be found. Probably you were looking for allowedDomains
and disallowedRoutes
properties. Try the following
JwtModule.forRoot({
config:{
tokenGetter:() => {
return localStorage.getItem('access_token');
},
allowedDomains: ['localhost:8080'],
disallowedRoutes:[]
}
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With