fix: reset_password security issue (#18363)

This commit is contained in:
Xiyuan Chen
2025-04-18 05:06:09 -04:00
committed by GitHub
parent 775dc47abe
commit 4247a6b807
4 changed files with 50 additions and 7 deletions

View File

@@ -210,3 +210,16 @@ def enterprise_license_required(view):
return view(*args, **kwargs)
return decorated
def email_password_login_enabled(view):
@wraps(view)
def decorated(*args, **kwargs):
features = FeatureService.get_system_features()
if features.enable_email_password_login:
return view(*args, **kwargs)
# otherwise, return 403
abort(403)
return decorated