techcsispit / MERN-Auth-Workouts-App

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

Closed Dash10107 closed 1 month ago

Dash10107 commented 1 month ago

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.

image

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.

image

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.

Dash10107 commented 1 month ago

I would like to work on this issue

Dash10107 commented 1 month ago

This issue has been resolved in the last pull request accepted.

techcsispit commented 1 month ago

I think this issue can be closed then