JwtModule.forRoot({
config: {
tokenGetter: () => {
return localStorage.getItem('access_token');
},
whitelistedDomains: ['localhost:3001']
}
})
i have been add this line in app.module.ts but on first run (ng serve) i am getting error.
ERROR in Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function (position 30:22 in the original .ts file), resolving symbol AppModule in ..../src/app/app.module.ts
And error line is tokenGetter.
Looking at the error message I suggest you to try the following solution.
export function getToken() {
return localStorage.getItem('access_token');
}
JwtModule.forRoot({
config: {
tokenGetter: getToken,
whitelistedDomains: ['localhost:3001']
}
})
@lekhnath damn. Thank you so much. Sometimes missing. Thank you again.
Most helpful comment
Looking at the error message I suggest you to try the following solution.