Skip to content

Commit

Permalink
use <svg> tag instead markdown image
Browse files Browse the repository at this point in the history
  • Loading branch information
awarecan committed Aug 26, 2018
1 parent b98f65d commit c3f699d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
7 changes: 5 additions & 2 deletions homeassistant/auth/mfa_modules/totp.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ def _generate_qr_code(data: str) -> str:

with BytesIO() as buffer:
qr_code.svg(file=buffer, scale=4)
return 'data:image/svg+xml;base64,{}'.format(
b64encode(buffer.getvalue()).decode("ascii"))
return '{}'.format(
buffer.getvalue().decode("ascii").replace('\n', '')
.replace('<?xml version="1.0" encoding="UTF-8"?>'
'<svg xmlns="http://www.w3.org/2000/svg"', '<svg')
)


def _generate_secret_and_qr_code(username: str) -> Tuple[str, str, str]:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/auth/.translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"step": {
"init": {
"description": "Scan the QR code with your authentication app, such as **Google Authenticator** or **Authy**. If you have problem to scan the QR code, using **`{code}`** to manual setup. \n\n![{url}]({qr_code})\n\nEnter the six digi code appeared in your app below to verify the setup:",
"description": "Scan the QR code with your authentication app, such as **Google Authenticator** or **Authy**. If you have problem to scan the QR code, using **`{code}`** to manual setup. \n\n{qr_code}\n\nEnter the six digi code appeared in your app below to verify the setup:",
"title": "Scan this QR code with your app"
}
},
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/auth/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"step": {
"init": {
"title": "Scan this QR code with your app",
"description": "Scan the QR code with your authentication app, such as **Google Authenticator** or **Authy**. If you have problem to scan the QR code, using **`{code}`** to manual setup. \n\n![{url}]({qr_code})\n\nEnter the six digi code appeared in your app below to verify the setup:"
"description": "Scan the QR code with your authentication app, such as **Google Authenticator** or **Authy**. If you have problem to scan the QR code, using **`{code}`** to manual setup. \n\n{qr_code}\n\nEnter the six digi code appeared in your app below to verify the setup:"
}
},
"error": {
Expand Down
4 changes: 3 additions & 1 deletion homeassistant/components/hangouts/.translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,23 @@
},
"error": {
"invalid_2fa": "Invalid 2 Factor Authorization, please try again.",
"invalid_2fa_method": "Invalig 2FA Method (Verify on Phone).",
"invalid_2fa_method": "Invalid 2FA Method (Verify on Phone).",
"invalid_login": "Invalid Login, please try again."
},
"step": {
"2fa": {
"data": {
"2fa": "2FA Pin"
},
"description": "",
"title": "2-Factor-Authorization"
},
"user": {
"data": {
"email": "E-Mail Address",
"password": "Password"
},
"description": "",
"title": "Google Hangouts Login"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"config": {
"abort": {
"already_configured": "Access point is already configured",
"conection_aborted": "Could not connect to HMIP server",
"connection_aborted": "Could not connect to HMIP server",
"unknown": "Unknown error occurred."
},
Expand Down

0 comments on commit c3f699d

Please sign in to comment.