Skip to content Skip to sidebar Skip to footer

Unauthorized: Error 401 Passport-jwt

passport.js var jwtOptions = { jwtFromRequest: ExtractJwt.fromAuthHeader(), secretOrKey: config.secret } var jwtLogin = new JwtStrategy(jwtOptions, functio

Solution 1:

In your headers.append() located in your service file your asking for Authorization, switch that to Authentication and see if that works

Solution 2:

headers.append('Authorization', 'JWT ' + this.auth.token);

Solution 3:

You can try this instead:

headers.append('Authorization', 'Bearer ${this.auth.token}');

Post a Comment for "Unauthorized: Error 401 Passport-jwt"