Problem/Motivation

The module works very well, but I've heard from clients that users get a little confused with the wording and interface when setting up the email OTP. I believe some of the text could be improved to make the workflow clearer for users.

Steps to reproduce

1. When user is enabling email OTP for the first time, the checkbox label is not very clear. I've heard that users usually expect to receive an access code when they submit this form, probably to verify they own the email address they're enabling email OTP for.
Current enable email OTP interface

However, they get surprised when they receive an email saying OTP is enabled, and they didn't get the access code they were expecting. We know an access code is not supposed to be sent when enabling, but users may get confused with that message.

2. For an user who has already enabled email OTP, when they log in to the site, they will see the following interface to send the authentication code.
Current send authentication code interface

Although the button "Verify" is clearly disabled, having the input element there requesting the authentication code at this moment is a bit misleading. I've heard user see that and they think the authentication code has already been sent, so they keep checking their email, until they realize they still need to click the button "Send". Some of them even think they may received the authentication code in a different email address, since there's no indication of what email address the authentication code is sent.

3. After the authentication code has been sent, the user is finally able to add the authentication code and verify it. But similar to the above, we don't let the user know what email address the email was sent to. We also don't say anything about how long the authentication code is valid.
Current verify authentication code interface

Proposed resolution

Improve the interfaces and texts above to make them clearer for users, according to the proposed user interface changes below.

Remaining tasks

None.

User interface changes

1. Modify the wording on the email OTP setup page, making it clear that the action will enable email OTP right away.
Proposed enable email OTP interface

2. On the interface to send the authentication code, remove the authentication code input element, and add a text informing the user that they must click on the button to send the authentication code to their email address. Show a masked version of their email address, for enhanced privacy protection. It's debatable if we should keep the button "Verify", but we can keep it as disabled, even to avoid breaking the current tests.
Proposed send authentication code interface

3. On the interface to verify the authentication code, we let the user know that the authentication code has been sent to their email address (again, a masked version of it), and also make clear when the authentication code will expire (based on the module's configuration).
Proposed verify authentication code interface

API changes

None.

Data model changes

None.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

maursilveira created an issue. See original summary.

maursilveira’s picture

StatusFileSize
new3.88 KB

I've created a merge request with the proposed interface changes.

I'm also attaching here a patch file for the same changes, for composer patches.

Please let me know if you have any questions. Thank you.

maursilveira’s picture

Status: Active » Needs review
maursilveira’s picture

StatusFileSize
new3.88 KB

I've just pushed two minor fixes for the MR, and I'm attaching an updated patch file.

mingsong’s picture

Status: Needs review » Needs work

Thanks for merge request.

It looks mostly good to me. Just two more changes would be better if we could have.

I left my comment about those changes required in the merge request.

Great work.

maursilveira’s picture

Hi @mingsong, thank you for reviewing and commenting.

I added a comment for you in the MR regarding the email masking. Please let me know what you think, and I'll proceed with the changes if necessary.

Thank you.

mingsong’s picture

Thanks @Mauricio.

I just replied your suggestion in the comment there.

We are almost there.

maursilveira’s picture

Hi @mingsong,

I've just added another comment with a suggestion to tackle this.

Please let me know what you think. Thank you.

mingsong’s picture

Status: Needs work » Needs review

mingsong’s picture

Version: 1.0.x-dev » 1.1.x-dev
Status: Needs review » Fixed

Merged into the 1.1.x develop branch.

Thank you.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.