Fix downloading personal keys outside of IDV (LG-5882)#6161
Fix downloading personal keys outside of IDV (LG-5882)#6161zachmargolis merged 3 commits intomainfrom
Conversation
…outside of identity verification
| link_to(idv_download_personal_key_path, **tag_options, &block) | ||
| link_to( | ||
| "data:text/plain;charset=utf-8,#{CGI.escape(code)}", | ||
| download: 'personal_key.txt', |
There was a problem hiding this comment.
one thought is maybe we can translate this filename? not that urgent IMO
There was a problem hiding this comment.
I think fine for a follow-up, yeah
| redirect_to next_step | ||
| end | ||
|
|
||
| # Remove this after the next deploy |
| get '/come_back_later' => 'come_back_later#show' | ||
| get '/personal_key' => 'personal_key#show' | ||
| post '/personal_key' => 'personal_key#update' | ||
| # Remove this after the next deploy |
There was a problem hiding this comment.
another thought --- I think we can convert the backup codes download functionality that does something similar
There was a problem hiding this comment.
I don't quite follow?
There was a problem hiding this comment.
We do the same "download" stuff in another controller and I think if we link this client-only approach, we should consider it there, too: https://github.com/18F/identity-idp/blob/main/app/controllers/users/backup_code_setup_controller.rb#L31-L34
| formEl.addEventListener('submit', handleSubmit); | ||
|
|
||
| if (window.navigator.msSaveBlob) { | ||
| downloadLink.addEventListener('click', downloadForIE); |
There was a problem hiding this comment.
I was not able to test this myself, but @mitchellhenke said in slack the download worked
|
Just wanted to flag this that I noticed in the removal PR, we won't have any |
* download personal key via data: URL or JS fallback for Internet Explorer * add specs and removal notes changelog: Bug Fixes, Personal keys, Fixes downloading personal keys outside of identity verification
**Why**: Unused as of #6161 changelog: Internal, Source code, Remove unused download code
**Why**: Unused as of #6161 changelog: Internal, Source code, Remove unused download code
Problem: the personal key partial is used in a few places outside of IDV, but always linked to the IDV version's of the
#downloadaction (which means it would trigger an IDV proofing process if used outside of IDV... very undesirable)Solution: stop using the
#downloadaction#downloadaction to other personal key controllers#downloadaction and its dependency on data in the session, so I think we're better off completely removing itNext steps: completely remove
#download