[GH-ISSUE #772] 2FA authentication should not be enabled until we confirm user has configured google authenticator #472

Closed
opened 2026-02-25 21:35:07 +03:00 by kerem · 10 comments
Owner

Originally created by @ElvisAns on GitHub (Sep 19, 2023).
Original GitHub issue: https://github.com/cypht-org/cypht/issues/772

Originally assigned to: @Yannick243 on GitHub.

🗣 Suggestion

Let's consider the following scenario

  1. Enable 2fa authentication
  2. Logout without scanning the setup QR code (this may happen to end users)
  3. Next time you login Cypht will ask you the 6digit code from Authenticator and you loose access to your account

Proposed solution

Before asking users to enter TOTP on login, we have to confirm they have google authenticator paired. Usually this is done by asking them to put the current TOPT during the configuration process and if match, we now enforce 2FA on next login.

Originally created by @ElvisAns on GitHub (Sep 19, 2023). Original GitHub issue: https://github.com/cypht-org/cypht/issues/772 Originally assigned to: @Yannick243 on GitHub. ## 🗣 Suggestion ### Let's consider the following scenario 1. Enable 2fa authentication 2. Logout without scanning the setup QR code (this may happen to end users) 3. Next time you login Cypht will ask you the 6digit code from Authenticator and you loose access to your account ### Proposed solution Before asking users to enter TOTP on login, we have to confirm they have google authenticator paired. Usually this is done by asking them to put the current TOPT during the configuration process and if match, we now enforce 2FA on next login.
kerem closed this issue 2026-02-25 21:35:07 +03:00
Author
Owner

@marclaporte commented on GitHub (Nov 4, 2023):

@ElvisAns Does the PR look good to you?

<!-- gh-comment-id:1793559213 --> @marclaporte commented on GitHub (Nov 4, 2023): @ElvisAns Does the PR look good to you?
Author
Owner

@ElvisAns commented on GitHub (Nov 5, 2023):

@marclaporte testing now, will share some feedback

<!-- gh-comment-id:1793708428 --> @ElvisAns commented on GitHub (Nov 5, 2023): @marclaporte testing now, will share some feedback
Author
Owner

@ElvisAns commented on GitHub (Nov 5, 2023):

@Yannick243 it looks good on my end

https://github.com/cypht-org/cypht/assets/35831811/d473311f-9334-4ad6-9189-d62834b7daba

@marclaporte what do you think about the flow above? User experience wise

<!-- gh-comment-id:1793717171 --> @ElvisAns commented on GitHub (Nov 5, 2023): @Yannick243 it looks good on my end https://github.com/cypht-org/cypht/assets/35831811/d473311f-9334-4ad6-9189-d62834b7daba @marclaporte what do you think about the flow above? User experience wise
Author
Owner

@marclaporte commented on GitHub (Nov 5, 2023):

I refer to @johnsantosDev for UX :-)

<!-- gh-comment-id:1793762086 --> @marclaporte commented on GitHub (Nov 5, 2023): I refer to @johnsantosDev for UX :-)
Author
Owner

@johnsantosDev commented on GitHub (Nov 5, 2023):

Let me give it a look Team

<!-- gh-comment-id:1793762815 --> @johnsantosDev commented on GitHub (Nov 5, 2023): Let me give it a look Team
Author
Owner

@johnsantosDev commented on GitHub (Nov 12, 2023):

Team, I tested this and the flow, works realy fine, just some very minor ui improvments related to the alignments.

  1. Enable two factor authentication text is very far from the checkbox, users will think the switch is for the text update your settings...
  2. we are using 2 columns here(good idea) but it's giving poor ui by making the left side empty.
    I suggest to have the switch, the QR and the text "if you can't ..... " at the left column and the section starting with "the following backup codes can ... " at the right.

WDYT @Yannick243 ?

Screenshot from 2023-11-13 01-02-54

<!-- gh-comment-id:1807273139 --> @johnsantosDev commented on GitHub (Nov 12, 2023): Team, I tested this and the flow, works realy fine, just some very minor ui improvments related to the alignments. 1. Enable two factor authentication text is very far from the checkbox, users will think the switch is for the text update your settings... 2. we are using 2 columns here(good idea) but it's giving poor ui by making the left side empty. I suggest to have the switch, the QR and the text "if you can't ..... " at the left column and the section starting with "the following backup codes can ... " at the right. WDYT @Yannick243 ? ![Screenshot from 2023-11-13 01-02-54](https://github.com/cypht-org/cypht/assets/92297941/802fe014-5d73-417c-a9e1-da2cebf48e72)
Author
Owner

@Yannick243 commented on GitHub (Nov 13, 2023):

Hello @johnsantosDev,
I have refactor the UI like this, what do you think ?

CleanShot Nov 13 from imagecompressor

<!-- gh-comment-id:1808318471 --> @Yannick243 commented on GitHub (Nov 13, 2023): Hello @johnsantosDev, I have refactor the UI like this, what do you think ? ![CleanShot Nov 13 from imagecompressor](https://github.com/cypht-org/cypht/assets/14950700/e79bd6d1-f4f0-4fb5-bf72-47eec731090f)
Author
Owner

@johnsantosDev commented on GitHub (Nov 13, 2023):

Perfect. Thanks @Yannick243

<!-- gh-comment-id:1808512115 --> @johnsantosDev commented on GitHub (Nov 13, 2023): Perfect. Thanks @Yannick243
Author
Owner

@Yannick243 commented on GitHub (Feb 2, 2024):

Hello @ElvisAns,
can this be closed as it has been merged ?

<!-- gh-comment-id:1923347037 --> @Yannick243 commented on GitHub (Feb 2, 2024): Hello @ElvisAns, can this be closed as it has been merged ?
Author
Owner

@ElvisAns commented on GitHub (Feb 6, 2024):

PR : https://github.com/cypht-org/cypht/pull/819

<!-- gh-comment-id:1929165506 --> @ElvisAns commented on GitHub (Feb 6, 2024): PR : https://github.com/cypht-org/cypht/pull/819
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cypht#472
No description provided.