Page MenuHomePhabricator

Add copy button to recovery codes page
Closed, ResolvedPublic

Description

Related to T245027: Enable downloading recovery codes for two-factor (TOTP), potentially add a "copy" button to the 2FA recovery codes screen.

Screenshot 2023-12-26 at 21.35.14.png (1×846 px, 103 KB)

Them embed it into the value (tokens purposefully changed)...

<clipboard-copy data-ga-click="2FA, copy recovery codes, view 2fa recovery codes form" data-action="click:recovery-codes#saveCodes" aria-label="Copy" value="eed12-c8f7a 
12345-67890 
12345-67890 
12345-67890 
12345-67890 
12345-67890 
12345-67890 
12345-67890 
12345-67890 
12345-67890 
12345-67890 
12345-67890 
12345-67890 
12345-67890 
12345-67890 
12345-67890" data-view-component="true" class="btn recovery-code-save-button" tabindex="0" role="button">
    
          <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy">
    <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path>
</svg>
          Copy

</clipboard-copy>

Event Timeline

Reedy renamed this task from Add copy button to scratch token page to Add copy button to recovery codes page.Jan 1 2024, 8:51 PM
Reedy updated the task description. (Show Details)

Change 989963 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/OATHAuth@master] WIP: Add copy button for recovery codes

https://gerrit.wikimedia.org/r/989963

Screenshot 2024-11-02 at 17.24.44.png (966×1 px, 210 KB)
Screenshot 2024-11-02 at 17.24.50.png (1×2 px, 846 KB)

[edit] Just in case anyone is wondering, these are codes in my docker instance, and have already been regenerated several times

Change #989963 merged by jenkins-bot:

[mediawiki/extensions/OATHAuth@master] Add copy button for recovery codes

https://gerrit.wikimedia.org/r/989963

Change #1089862 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/OATHAuth@REL1_43] Add copy button for recovery codes

https://gerrit.wikimedia.org/r/1089862

Reedy claimed this task.
Reedy updated Other Assignee, added: TheDJ.

Change #1089862 merged by jenkins-bot:

[mediawiki/extensions/OATHAuth@REL1_43] Add copy button for recovery codes

https://gerrit.wikimedia.org/r/1089862

Tgr subscribed.

The copy button is now receiving submit actions via the Enter key (since it's first in document order), which isn't great.

Change #1134381 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/extensions/OATHAuth@master] Do not make Copy button the default submit action on TOTP form

https://gerrit.wikimedia.org/r/1134381

Change #1134381 merged by jenkins-bot:

[mediawiki/extensions/OATHAuth@master] Do not make Copy button the default submit action on TOTP form

https://gerrit.wikimedia.org/r/1134381

Change #1135792 had a related patch set uploaded (by Reedy; author: Gergő Tisza):

[mediawiki/extensions/OATHAuth@REL1_43] Do not make Copy button the default submit action on TOTP form

https://gerrit.wikimedia.org/r/1135792

Change #1135792 merged by jenkins-bot:

[mediawiki/extensions/OATHAuth@REL1_43] Do not make Copy button the default submit action on TOTP form

https://gerrit.wikimedia.org/r/1135792