You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The app currently returns user info (e.g., name and email) upon login, but there's no mechanism to validate if the user is actively logged in during other actions. This makes it impossible to confirm authentication status for actions like creating a company.
Proposed Solution
Backend: Generate and return an access token on login. Validate the token for protected actions.
Frontend: Store the token in a context provider for global accessibility and use it to verify user authentication before actions like creating a company.
Why This is Needed
Ensures only authenticated users can perform protected actions.
Simplifies frontend state management by avoiding prop drilling with a global context.
Clearly validates if a user is logged in.
Acceptance Criteria
Backend generates and validates access tokens.
Frontend stores tokens in a context provider.
Token validation implemented for protected actions.
Documentation on using context provider for authentication state.
Example
Currently, Melchor cannot validate if a user is logged in when trying to create a company. Adding access token functionality resolves this issue and ensures authentication at every step.
The text was updated successfully, but these errors were encountered:
Problem
The app currently returns user info (e.g., name and email) upon login, but there's no mechanism to validate if the user is actively logged in during other actions. This makes it impossible to confirm authentication status for actions like creating a company.
Proposed Solution
Why This is Needed
Acceptance Criteria
Example
Currently, Melchor cannot validate if a user is logged in when trying to create a company. Adding access token functionality resolves this issue and ensures authentication at every step.
The text was updated successfully, but these errors were encountered: