Skip to content

Commit 254a9ec

Browse files
jbouwhfrenck
authored andcommitted
Move URLs out of strings.json for auth (home-assistant#154769)
1 parent a518907 commit 254a9ec

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

homeassistant/auth/mfa_modules/totp.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434

3535
DUMMY_SECRET = "FPPTH34D4E3MI2HG"
3636

37+
GOOGLE_AUTHENTICATOR_URL = "https://support.google.com/accounts/answer/1066447"
38+
AUTHY_URL = "https://authy.com/"
39+
3740

3841
def _generate_qr_code(data: str) -> str:
3942
"""Generate a base64 PNG string represent QR Code image of data."""
@@ -229,6 +232,8 @@ async def async_step_init(
229232
"code": self._ota_secret,
230233
"url": self._url,
231234
"qr_code": self._image,
235+
"google_authenticator_url": GOOGLE_AUTHENTICATOR_URL,
236+
"authy_url": AUTHY_URL,
232237
},
233238
errors=errors,
234239
)

homeassistant/components/auth/strings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"step": {
66
"init": {
77
"title": "Set up two-factor authentication using TOTP",
8-
"description": "To activate two-factor authentication using time-based one-time passwords, scan the QR code with your authentication app. If you don't have one, we recommend either [Google Authenticator](https://support.google.com/accounts/answer/1066447) or [Authy](https://authy.com/).\n\n{qr_code}\n\nAfter scanning the code, enter the six-digit code from your app to verify the setup. If you have problems scanning the QR code, do a manual setup with code **`{code}`**."
8+
"description": "To activate two-factor authentication using time-based one-time passwords, scan the QR code with your authentication app. If you don't have one, we recommend either [Google Authenticator]({google_authenticator_url}) or [Authy]({authy_url}).\n\n{qr_code}\n\nAfter scanning the code, enter the six-digit code from your app to verify the setup. If you have problems scanning the QR code, do a manual setup with code **`{code}`**."
99
}
1010
},
1111
"error": {

0 commit comments

Comments
 (0)