This Workouts App is a full-stack CRUD application built using the MERN stack (MongoDB, Express, React, Node.js) with authentication implemented using Bcrypt and JWT. The app allows users to create, update, view, and delete workouts once they are authenticated. Contributions are welcome to improve styling, fix bugs, and add features.
0
stars
2
forks
source link
User Unable to Add Exercise Due to Expired Token Error #4
Problem:
Users are encountering an "Authorization token required" error while trying to add exercises to the app (as shown in the screenshot). This issue occurs because the token is not being validated correctly.
Cause:
The issue stems from the middleware where the code checks for "authorisation" instead of the correct spelling "authorization." As a result, the middleware fails to recognize the token and thus the user, leading to the error.
Why It’s Important:
Without fixing this, users are unable to add their workouts or interact with the app's main functionality. This breaks the user experience and prevents further app engagement.
Proposed Solution:
Update the middleware to check for "authorization" instead of "authorisation."
Ensure token validation is functioning correctly across all routes that require user authentication.
Test thoroughly to ensure the issue is resolved.
Problem: Users are encountering an "Authorization token required" error while trying to add exercises to the app (as shown in the screenshot). This issue occurs because the token is not being validated correctly.
Cause: The issue stems from the middleware where the code checks for "authorisation" instead of the correct spelling "authorization." As a result, the middleware fails to recognize the token and thus the user, leading to the error.
Why It’s Important: Without fixing this, users are unable to add their workouts or interact with the app's main functionality. This breaks the user experience and prevents further app engagement.
Proposed Solution: Update the middleware to check for "authorization" instead of "authorisation." Ensure token validation is functioning correctly across all routes that require user authentication. Test thoroughly to ensure the issue is resolved.