ros*_*osa 4 jwt typescript google-oauth angular
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:[]
}
})
],
Run Code Online (Sandbox Code Playgroud)
Mic*_*l D 12
如果您查看JwtConfig界面,则找不到whitelistedDomains和blacklistedRoutes属性。可能你正在寻找allowedDomains和disallowedRoutes属性。尝试以下
JwtModule.forRoot({
config:{
tokenGetter:() => {
return localStorage.getItem('access_token');
},
allowedDomains: ['localhost:8080'],
disallowedRoutes:[]
}
})
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2159 次 |
| 最近记录: |