DEV Community

Discussion on: How to authenticate and protect REST API routes with JWT and refresh tokens

 
renzhamin profile image
renzhamin

The protected route /users go through the verifyAccessToken middleware which verifies the token before giving the list of users, and return Unauthorized if the token wasn't valid
I am not sure what you mean by "avoid that being a user's decision". You mean the client making the request right ? In that case theres no way to bypass the verification if thats your concern