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

#23187419173 - fx:fixed Two Factor Authentication for Sellers #35

Merged
merged 1 commit into from
Apr 29, 2024

Conversation

soleil00
Copy link
Collaborator

What does this PR do?

This PR sets up Two Factor Authentication for Sellers

Description of Task to be completed?

-GIVEN there is a request to log in a user to the website
WHEN 2FA is enabled on the particular user
THEN Further request for a 2FA token should be requested and once the token is received and validated, the user is allowed to log in.

How should this be manually tested?

  1. checkout this branch and run app
  2. regiter new user with extra filed isMerchant field set to true
  3. then login with email and password
  4. there u will see magic happen u will get message that verification token has been sent to ur email
  5. go there open email and copy token and send them in req.body to specified endpoint in body /api/v1/users/2fa-verify

pivotal tracker id ----> #23187419173

Screenshots

Screenshot 2024-04-29 at 13 26 56 Screenshot 2024-04-29 at 13 30 48 Screenshot 2024-04-29 at 13 27 18

@codecov-commenter
Copy link

codecov-commenter commented Apr 29, 2024

Codecov Report

Attention: Patch coverage is 57.74648% with 30 lines in your changes are missing coverage. Please review.

Project coverage is 78.26%. Comparing base (dc505f3) to head (e77f265).

Files Patch % Lines
src/controllers/userControllers.ts 48.48% 16 Missing and 1 partial ⚠️
src/middlewares/isTokenFound.ts 18.18% 9 Missing ⚠️
src/services/user.service.ts 62.50% 3 Missing ⚠️
src/services/mail.service.ts 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev      #35      +/-   ##
==========================================
- Coverage   83.45%   78.26%   -5.20%     
==========================================
  Files          23       24       +1     
  Lines         278      299      +21     
  Branches       33       40       +7     
==========================================
+ Hits          232      234       +2     
- Misses         46       64      +18     
- Partials        0        1       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@soleil00 soleil00 changed the title #23187419173 - fx:fixed up Two Factor Authentication for Sellers #23187419173 - fx:fixed Two Factor Authentication for Sellers Apr 29, 2024
@soleil00 soleil00 force-pushed the fx-2f-authentication-#187419173 branch from fcff1e3 to e77f265 Compare April 29, 2024 13:47
await queryInterface.addColumn("users", "role", {
type: Sequelize.ARRAY(Sequelize.STRING),
defaultValue: ["buyer"],
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrecoverable syntax error. (56% scanned).

/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.addColumn("users", "role", {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected an assignment or function call and instead saw an expression.
Missing semicolon.


/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected ':' and instead saw 'up'.
Expected '}' to match '{' from line 4 and instead saw '{'.
Missing semicolon.

@@ -0,0 +1,15 @@
"use strict";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the function form of "use strict".

allowNull: false,
type: Sequelize.DATE,
},
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrecoverable syntax error. (76% scanned).


module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.createTable("tokens", {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected an assignment or function call and instead saw an expression.
Missing semicolon.

"use strict";

module.exports = {
async up(queryInterface, Sequelize) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected ':' and instead saw 'up'.
Expected '}' to match '{' from line 3 and instead saw '{'.
Missing semicolon.

@@ -0,0 +1,29 @@
"use strict";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the function form of "use strict".

await queryInterface.addColumn("users", "role", {
type: Sequelize.ARRAY(Sequelize.STRING),
defaultValue: ["buyer"],
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrecoverable syntax error. (56% scanned).

/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.addColumn("users", "role", {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected an assignment or function call and instead saw an expression.
Missing semicolon.


/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected ':' and instead saw 'up'.
Expected '}' to match '{' from line 4 and instead saw '{'.
Missing semicolon.

@@ -0,0 +1,15 @@
"use strict";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the function form of "use strict".

await queryInterface.addColumn("users", "role", {
type: Sequelize.ARRAY(Sequelize.STRING),
defaultValue: ["buyer"],
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrecoverable syntax error. (56% scanned).

/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.addColumn("users", "role", {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected an assignment or function call and instead saw an expression.
Missing semicolon.


/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected ':' and instead saw 'up'.
Expected '}' to match '{' from line 4 and instead saw '{'.
Missing semicolon.

@@ -0,0 +1,15 @@
"use strict";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the function form of "use strict".

allowNull: false,
type: Sequelize.DATE,
},
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrecoverable syntax error. (76% scanned).

@@ -0,0 +1,29 @@
"use strict";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the function form of "use strict".

module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.removeColumn("users", "twoFAEnabled");
await queryInterface.removeColumn("users", "isMerchant");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected an assignment or function call and instead saw an expression.
Missing semicolon.
Unrecoverable syntax error. (46% scanned).

/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.removeColumn("users", "twoFAEnabled");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected an assignment or function call and instead saw an expression.
Missing semicolon.


/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected ':' and instead saw 'up'.
Expected '}' to match '{' from line 4 and instead saw '{'.
Missing semicolon.

@@ -0,0 +1,14 @@
"use strict";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the function form of "use strict".

@teerenzo teerenzo merged commit fb51f5b into dev Apr 29, 2024
3 checks passed
niyobertin pushed a commit that referenced this pull request Apr 29, 2024
#23187419173 - fx:fixed Two Factor Authentication for Sellers
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.

3 participants