mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-10-03 07:46:18 +00:00
Update dashboard.py
Fixed the issue where TOTP Key is not actually reset when reset.
This commit is contained in:
@@ -2957,7 +2957,7 @@ def API_isTotpEnabled():
|
|||||||
@app.get(f'{APP_PREFIX}/api/Welcome_GetTotpLink')
|
@app.get(f'{APP_PREFIX}/api/Welcome_GetTotpLink')
|
||||||
def API_Welcome_GetTotpLink():
|
def API_Welcome_GetTotpLink():
|
||||||
if not DashboardConfig.GetConfig("Account", "totp_verified")[1]:
|
if not DashboardConfig.GetConfig("Account", "totp_verified")[1]:
|
||||||
DashboardConfig.SetConfig("Account", "totp_key", pyotp.random_base32())
|
DashboardConfig.SetConfig("Account", "totp_key", pyotp.random_base32(), True)
|
||||||
return ResponseObject(
|
return ResponseObject(
|
||||||
data=pyotp.totp.TOTP(DashboardConfig.GetConfig("Account", "totp_key")[1]).provisioning_uri(
|
data=pyotp.totp.TOTP(DashboardConfig.GetConfig("Account", "totp_key")[1]).provisioning_uri(
|
||||||
issuer_name="WGDashboard"))
|
issuer_name="WGDashboard"))
|
||||||
|
Reference in New Issue
Block a user