forked from platypush/platypush
[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:
parent
38756119c4
commit
46321559ab
1 changed files with 1 additions and 1 deletions
|
@ -80,7 +80,7 @@ class OtpPlugin(Plugin):
|
||||||
|
|
||||||
:return: The new secret token.
|
:return: The new secret token.
|
||||||
"""
|
"""
|
||||||
return pyotp.random_base32()
|
return str(pyotp.random_base32())
|
||||||
|
|
||||||
@action
|
@action
|
||||||
def refresh_secret(self, secret_path: Optional[str] = None) -> str:
|
def refresh_secret(self, secret_path: Optional[str] = None) -> str:
|
||||||
|
|
Loading…
Reference in a new issue