CSRF secret key bugfix, updated deps, compose yml: removed start_period key

This commit is contained in:
DarkCat09 2023-03-09 17:11:18 +04:00
parent 8b61a6bf8d
commit 856241e58d
5 changed files with 6 additions and 10 deletions

View file

@ -18,8 +18,7 @@ static_dir = str(
# Main configuration
class Settings(BaseSettings):
debug: bool = False
session_key: str = secrets.token_hex(32)
csrf_key: str = secrets.token_hex(32)
secret_key: str = secrets.token_hex(32)
app_host: str = '127.0.0.1'
app_port: int = 8000

View file

@ -42,9 +42,9 @@ for p in paths:
# Add WTForms CSRF protection middlewares
app.add_middleware(
SessionMiddleware,
secret_key=common.settings.session_key,
secret_key=common.settings.secret_key,
)
app.add_middleware(
CSRFProtectMiddleware,
csrf_secret=common.settings.csrf_key,
csrf_secret=common.settings.secret_key,
)