Encountering an error in my IntelliJ IDE while trying to utilize decodedJwt.scope
.
The specific error message reads: Property 'scope' is not available on type 'JwtPayload'. Suggestions offered by IntelliJ include: sub, aud, exp, iat, jti, iss, and nbf.
loadProfile(data: any) {
this.isAuthenticated = true;
this.accessToken = data['access-token'];
let decodedJwt = jwtDecode(this.accessToken);
this.username = decodedJwt.sub;
this.roles = decodedJwt.scope;
window.localStorage.setItem("jwt-token", this.accessToken);
}
Prior usage of decodedJwt.scope
was successful, but it has abruptly disappeared. Seeking advice from those who may have encountered this issue before or know how to rectify it.