Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Access Token for Authentication Validation (Blocking Issue) #13

Closed
4 tasks
jphill19 opened this issue Dec 4, 2024 · 0 comments
Closed
4 tasks

Add Access Token for Authentication Validation (Blocking Issue) #13

jphill19 opened this issue Dec 4, 2024 · 0 comments
Assignees

Comments

@jphill19
Copy link
Collaborator

jphill19 commented Dec 4, 2024

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

  1. Backend: Generate and return an access token on login. Validate the token for protected actions.
  2. 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.

@jphill19 jphill19 pinned this issue Dec 4, 2024
@MDelarosa1993 MDelarosa1993 self-assigned this Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants