Include the otpauth url when retrieving the QR svg #356
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This small change adds the otpauth:// url to the json output when retrieving the QR code svg image.
On some devices, notably iOS 15 and macOS Monterey, it is possible to add the 2 step verification code directly in the system keychain. This allows for autofilling the verification code, so no need for switch to another app. Note that the input for the verification code has to be marked with
autocomplete="one-time-token"
.However, this nice feature is difficult if not impossible to use when only showing the QR code image, because the camera can not see it's own screen if you know what I mean 馃憖.
Adding the url makes it possible to show a button 'Add on this device', that simply is a link to the otpauth url. Clicking it will open the system dialog to confirm and add it to a specific account. I tested on both iOS and macOS and it works.
See also the Apple documentation, the mention an apple specific prefix, but it works also without the prefix.