Release v2.2: admin auth settings, Passkey RP ID, Cloudflare and Google captcha
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -90,6 +90,32 @@ def create_app(setup_database=True):
|
||||
except Exception:
|
||||
return {"site_banners": {}}
|
||||
|
||||
@app.context_processor
|
||||
def inject_auth_settings():
|
||||
from app.settings_service import get_auth_public_settings
|
||||
|
||||
try:
|
||||
return {"auth_settings": get_auth_public_settings()}
|
||||
except Exception:
|
||||
return {
|
||||
"auth_settings": {
|
||||
"registration_enabled": True,
|
||||
"password_login_enabled": True,
|
||||
"passkey_enabled": True,
|
||||
}
|
||||
}
|
||||
|
||||
@app.context_processor
|
||||
def inject_captcha():
|
||||
from flask import request
|
||||
|
||||
from app.captcha_service import get_captcha_config_for_request
|
||||
|
||||
try:
|
||||
return {"captcha_config": get_captcha_config_for_request(request.endpoint)}
|
||||
except Exception:
|
||||
return {"captcha_config": None}
|
||||
|
||||
if setup_database:
|
||||
with app.app_context():
|
||||
from app.bootstrap import (
|
||||
|
||||
Reference in New Issue
Block a user