server-tools icon indicating copy to clipboard operation
server-tools copied to clipboard

[10.0] auth_totp fail with accents

Open syci opened this issue 4 years ago • 2 comments

In the next line of code, with a name with accents, the generation of the QR fails

https://github.com/OCA/server-tools/blob/1c5d6bbbd78386d8a946edb3a68416ef557d3319/auth_totp/wizards/res_users_authenticator_create.py#L78

  File "/home/odoo/odoo/OCA/server-tools/auth_totp/wizards/res_users_authenticator_create.py", line 78, in _compute_qr_code_tag
    issuer_name=record.user_id.company_id.display_name,
  File "/usr/local/lib/python2.7/dist-packages/pyotp/totp.py", line 88, in provisioning_uri
    digits=self.digits, period=self.interval)
  File "/usr/local/lib/python2.7/dist-packages/pyotp/utils.py", line 63, in build_uri
    label = quote(issuer_name) + ':' + label
  File "/usr/lib/python2.7/urllib.py", line 1300, in quote
    return ''.join(map(quoter, s))
KeyError: u'\xe9'

The issuer_name value: Mario José .....

syci avatar Feb 08 '21 12:02 syci

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.

github-actions[bot] avatar Sep 26 '21 12:09 github-actions[bot]

I have the same issue on V8. The problem comes from the accent on the company name (the comment makes think that this is user name).

tcamberlin avatar Jun 22 '23 20:06 tcamberlin

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.

github-actions[bot] avatar Mar 30 '25 12:03 github-actions[bot]