Browse Source

Ensure no special chars are passed to totp.provisioning_uri

pull/1121/head
Akim Juillerat 7 years ago
parent
commit
e76742a767
  1. 2
      auth_totp/__manifest__.py
  2. 2
      auth_totp/wizards/res_users_authenticator_create.py

2
auth_totp/__manifest__.py

@ -5,7 +5,7 @@
{
'name': 'MFA Support',
'summary': 'Allows users to enable MFA and add optional trusted devices',
'version': '10.0.1.0.0',
'version': '10.0.1.0.1',
'category': 'Extra Tools',
'website': 'https://laslabs.com/',
'author': 'LasLabs, Odoo Community Association (OCA)',

2
auth_totp/wizards/res_users_authenticator_create.py

@ -74,7 +74,7 @@ class ResUsersAuthenticatorCreate(models.TransientModel):
totp = pyotp.TOTP(record.secret_key)
provisioning_uri = totp.provisioning_uri(
record.user_id.display_name,
record.user_id.display_name.encode('utf-8'),
issuer_name=record.user_id.company_id.display_name,
)
provisioning_uri = urllib.quote(provisioning_uri)

Loading…
Cancel
Save