UNLV-CS472-672 / 2024-S-GROUP5-Munch

The Munch app is a social platform where users create profiles by selecting preferred foods.
1 stars 11 forks source link

Token Decoding Issue #61

Closed rparker2003 closed 5 months ago

rparker2003 commented 5 months ago

Describe the bug The frontend development has gotten to the point of testing backend routes and the original way we decoded JWT tokens is now invalid. JWT tokens are sent with a "Bearer" prefix in the Authentication header which needed to be overlooked for decoding, and the field of the token with the data is now "sub" instead of "uid".

To Reproduce Steps to reproduce the behavior:

  1. Add prefix "Bearer" to the JWT token in the Authentication header in Postman, and test any routes. It throws an error saying invalid token but this is simply due to the Bearer prefix.