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

Chore/mobile/refactor testing for mobile #256

Closed
wants to merge 41 commits into from

Conversation

u21631532
Copy link
Contributor

Description

This pull request implements a new feature for user authentication using JWT tokens. The changes include:

  1. Updating the user login and registration endpoints to use JWT
  2. Implementing middleware for protected routes that require authentication

This change improves the security of our application by replacing the old session-based authentication with a more scalable token-based approach.

Fixes #255

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

The following tests were conducted to verify the changes:

  • Unit tests for AuthService, APIService,Navbar,User,Bookings, Notifications etc.' methods (token generation, validation)
  • Integration tests for login and registration endpoints
  • End-to-end tests for protected routes

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

KamogeloMoeketse and others added 30 commits July 23, 2024 22:10
      √ should return token when it exists (1 ms)
      √ should return undefined when token does not exist (1 ms)
Tests:       16 passed, 16 total
This commit adds an authentication check before making the API call to fetch user bookings. If the authentication token is not found, an error response is returned with the appropriate error code and message.
Tests:       13 passed, 13 total
Snapshots:   0 total
Time:        4.245 s
@u21631532 u21631532 added type: testing This affects one or more tests For: frontend This is mainly related to frontend UI code priority: high This needs/needed to be addressed as soon as possible state: approved This is complete and can be merged/closed effort: 8 This may require/required a week of work at minimum platform: mobile This is related to mobile platforms type: actions This relates to github actions for ci/cd labels Jul 30, 2024
@u21631532 u21631532 added this to the Week 5 Sprint 3 milestone Jul 30, 2024
@u21631532 u21631532 self-assigned this Jul 30, 2024
Copy link

gitguardian bot commented Jul 30, 2024

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
13149987 Triggered Generic Password 7ba4f7f frontend/occupi-mobile4/services/authservices.ts View secret
13149987 Triggered Generic Password 5c4f173 frontend/occupi-mobile4/services/authservices.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@u21631532 u21631532 closed this Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: 8 This may require/required a week of work at minimum For: frontend This is mainly related to frontend UI code platform: mobile This is related to mobile platforms priority: high This needs/needed to be addressed as soon as possible state: approved This is complete and can be merged/closed type: actions This relates to github actions for ci/cd type: testing This affects one or more tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unit Testing for Mobile
2 participants