[otp] Explicitly cast the output of otp.generate_secret to string.

Some versions of `pyotp` may return an intermediate
`pyotp.random_base32` object that is not JSON-serializable.
This commit is contained in:
Fabio Manganiello 2024-11-10 18:52:10 +01:00
parent 38756119c4
commit 46321559ab
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -80,7 +80,7 @@ class OtpPlugin(Plugin):
:return: The new secret token.
"""
return pyotp.random_base32()
return str(pyotp.random_base32())
@action
def refresh_secret(self, secret_path: Optional[str] = None) -> str: