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

Two factor authentication #330

Closed
wants to merge 1 commit into from
Closed

Conversation

Virgile1k
Copy link

@Virgile1k Virgile1k commented Oct 20, 2023

PR Description

This is pr is for enabling user for security enhancement on his or her Account by enabling two factor authentication

Description of tasks that were expected to be completed

List all the tasks and sub-tasks that were assigned to you or that you assigned yourself. Make sure you check evey completed task.

How has this been tested?

npm run dev
login using any credentials
on dashboard got to settings
go on privacy and security settings click on change
enable two factor authentication or disable it
By enabling two factor authentication the pop tell we send you code to verify two factor authentication enter code we send you and then 2fa will be enabled on time of login when you have enabled two fa you we the otp code in gmail inbox verify it and then you will progress to Dashboard.

Number of Commits

The number of commits should not exceed 2 commits. In case they are more than that, please take your time and squash them.

Screenshots (If appropriate)

Screen Shot 2023-10-20 at 14 49 40 Screen Shot 2023-10-20 at 14 49 30 Screen Shot 2023-10-20 at 14 48 54 # Please check this Checklist before you submit your PR:
  • 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
  • My code generate no warnings
  • My test coverage meet the set test coverage threshold
  • There are no vulnerabilities
  • There are no conflicts with the base branch

@vercel
Copy link

vercel bot commented Oct 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
metron-devpulse ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 17, 2023 1:43pm

Copy link
Contributor

@ceelogre ceelogre left a comment

Choose a reason for hiding this comment

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

There is no way to close the modal
image

Wrong verification throws an error in console
image

Comment on lines +38 to +44
const response = await disableTwoFactorAuth({
variables: { email: userProfileEmail },
});

console.log(response.data.disableTwoFactorAuth);
toast.success('2FA Disabled'); // Display success toast
setIsTwoFactorDisabled(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you don't check the value of response before setting the new value for setIsTwoFactoDisabled state, how do you know if disabling was successful?

Comment on lines +41 to +49
const response = await enableTwoFactorAuth({
variables: { email: userProfileEmail },
});

console.log(response.data.enableTwoFactorAuth);
toast.success('OTP check email sent! Check your inbox.');
setIsTwoFactorEnabled(true);
} catch (error) {
console.error(error);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as above.

Comment on lines +1 to +11
// /* eslint-disable */
// import { useApolloClient, useMutation } from '@apollo/client';
// import React, { useContext, useState } from 'react';
// import { useForm } from 'react-hook-form';
// import { useTranslation } from 'react-i18next';
// import { FaRegEnvelope, FaRegEye } from 'react-icons/fa';
// import { FiEyeOff } from 'react-icons/fi';
// import { MdLockOutline } from 'react-icons/md';
// import {
// Link,
// useLocation,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why a whole file that is full of comments?


await client.resetStore();

toast.success(t(data.loginUser.message) as ToastContent<unknown>);
Copy link
Contributor

Choose a reason for hiding this comment

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

We talked about removing this toast.

@ceelogre
Copy link
Contributor

Re-implemented.

@ceelogre ceelogre closed this Nov 19, 2024
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.

7 participants