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

[#187364733] -Ft two factor authentication for sellers #46

Merged
merged 1 commit into from
May 14, 2024

Conversation

EricNiyo73
Copy link
Collaborator

@EricNiyo73 EricNiyo73 commented Apr 30, 2024

What does this PR do?
This PR introduces the functionality for users, specifically Sellers, to enable two-factor authentication (2FA) for added security when logging into the application.

Description of Task to be completed?
The task involves implementing the logic to allow users to enable 2FA for their accounts. When 2FA is enabled for a user, they should be prompted to provide an additional authentication factor, such as an token and OTP code sent via email, during the login process.

How should this be manually tested?
Attempt to log in to the user account with 2FA enabled.
Verify that the login process prompts for a 2FA token i.e jwt token and OTP code sent via email of a user.
Enter a valid 2FA token and submit the form.

Any background context you want to provide?
Verify that the user is successfully logged in after the 2FA token is validated.
Implementing 2FA adds an extra layer of security to user accounts, especially for users with elevated privileges like Sellers who may have access to sensitive data or functionalities.

What are the relevant pivotal tracker/Trello stories?
[#187364733]
Screenshots (if appropriate)

  1. A user try to login with valid credentials, if a userRole is a seller, might get this response.
    image

  2. OTP sent and well received via email.
    image

  3. A user if tries to insert OTP token which is not provided and also that OTP does not corresponded to his/her email
    image

  4. A user finally entered a valid OTP code and authenticated successfully and also token would be generated for login.

image

@EricNiyo73 EricNiyo73 added the WIP Work in progress label Apr 30, 2024
@EricNiyo73 EricNiyo73 force-pushed the ft-Two-Factor-Authentication-for-Sellers branch from 822e393 to bd61670 Compare April 30, 2024 09:25
@coveralls
Copy link

coveralls commented Apr 30, 2024

Coverage Status

coverage: 97.033% (+0.5%) from 96.54%
when pulling 52b6581 on ft-Two-Factor-Authentication-for-Sellers
into 40770ff on develop.

@coveralls
Copy link

Coverage Status

coverage: 100.0%. remained the same
when pulling bd61670 on ft-Two-Factor-Authentication-for-Sellers
into cdfb665 on develop.

@EricNiyo73 EricNiyo73 force-pushed the ft-Two-Factor-Authentication-for-Sellers branch 2 times, most recently from 0b37f0d to f4ed1c5 Compare May 2, 2024 09:33
src/controllers/LoginController.ts Outdated Show resolved Hide resolved
src/controllers/LoginController.ts Outdated Show resolved Hide resolved
src/database/migrations/20240501111006-Users.js Outdated Show resolved Hide resolved
src/middlewares/otpMiddleware.ts Outdated Show resolved Hide resolved
src/middlewares/userMiddleware.ts Outdated Show resolved Hide resolved
@EricNiyo73 EricNiyo73 force-pushed the ft-Two-Factor-Authentication-for-Sellers branch 6 times, most recently from ded5116 to 0fa3a0a Compare May 4, 2024 08:01
src/controllers/LoginController.ts Show resolved Hide resolved
src/controllers/LoginController.ts Outdated Show resolved Hide resolved
@EricNiyo73 EricNiyo73 force-pushed the ft-Two-Factor-Authentication-for-Sellers branch 10 times, most recently from 2894eff to 6c5d08d Compare May 5, 2024 17:56
@EricNiyo73 EricNiyo73 added Ready for peer review and removed WIP Work in progress labels May 5, 2024
@EricNiyo73 EricNiyo73 force-pushed the ft-Two-Factor-Authentication-for-Sellers branch 6 times, most recently from 3e0a0dc to 007029c Compare May 13, 2024 14:01
src/database/migrations/20240509172841-Users.js Outdated Show resolved Hide resolved
src/database/migrations/20240509172841-Users.js Outdated Show resolved Hide resolved
src/database/migrations/20240509172841-Users.js Outdated Show resolved Hide resolved
src/database/migrations/20240509172841-Users.js Outdated Show resolved Hide resolved
src/database/migrations/20240509172841-Users.js Outdated Show resolved Hide resolved
@EricNiyo73 EricNiyo73 force-pushed the ft-Two-Factor-Authentication-for-Sellers branch 2 times, most recently from 71742d7 to 88f4ba2 Compare May 13, 2024 14:29
@EricNiyo73 EricNiyo73 removed the request for review from didasmbalanya May 13, 2024 15:00
.codeclimate.yml Outdated Show resolved Hide resolved
src/utils/hashPassword.ts Outdated Show resolved Hide resolved
src/utils/hashPassword.ts Outdated Show resolved Hide resolved
@AngeloChristian1 AngeloChristian1 self-requested a review May 13, 2024 16:56
@EricNiyo73 EricNiyo73 force-pushed the ft-Two-Factor-Authentication-for-Sellers branch from 88f4ba2 to 7167412 Compare May 13, 2024 17:36
feature(2FA): Two Factor Authentication for Sellers

feature(2FA): Two Factor Authentication for Sellers only

feature(2FA): Two Factor Authentication for Sellers only
@EricNiyo73 EricNiyo73 force-pushed the ft-Two-Factor-Authentication-for-Sellers branch from 7167412 to 52b6581 Compare May 13, 2024 20:24
Copy link

codeclimate bot commented May 13, 2024

Code Climate has analyzed commit 52b6581 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 98.2% (0.4% change).

View more on Code Climate.

@munezerobagira munezerobagira merged commit 5ddecf6 into develop May 14, 2024
8 checks passed
Yvan-David pushed a commit that referenced this pull request May 14, 2024
feature(2FA): Two Factor Authentication for Sellers

[Delivers #187364733]

Co-authored-by: Gatete Ishema Angelo Christian <[email protected]>
Yvan-David pushed a commit that referenced this pull request May 14, 2024
feature(2FA): Two Factor Authentication for Sellers

[Delivers #18736473]

Co-authored-by: Gatete Ishema Angelo Christian <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants