Working on LoginPage tests

This commit is contained in:
2025-10-26 22:45:34 +01:00
parent b98e52378e
commit 09d012d065
7 changed files with 900 additions and 320 deletions
+3 -2
View File
@@ -18,7 +18,7 @@ from ..auth.utils import (
)
def setup_auth_routes(app, rt, mount_auth_app=True):
def setup_auth_routes(app, rt, mount_auth_app=True, sqlite_db_path="Users.db"):
"""
Setup all authentication and protected routes.
@@ -26,6 +26,7 @@ def setup_auth_routes(app, rt, mount_auth_app=True):
app: FastHTML application instance
rt: Route decorator from FastHTML
mount_auth_app: Whether to mount the auth FastApi API routes
sqlite_db_path: by default, create a new SQLite database at this path
"""
# ============================================================================
@@ -187,7 +188,7 @@ def setup_auth_routes(app, rt, mount_auth_app=True):
def mount_auth_fastapi_api():
# Mount FastAPI auth backend
auth_api = create_auth_app_for_sqlite("Users.db", "jwt-secret-to-change")
auth_api = create_auth_app_for_sqlite(sqlite_db_path, "jwt-secret-to-change")
app.mount("/auth", auth_api)
if mount_auth_app:
+3 -1
View File
@@ -27,8 +27,10 @@ DEFAULT_SKIP_PATTERNS = [
r'.*\.css',
r'.*\.js',
'/login',
'/login2',
'/login-p',
'/register',
'/register-p',
'/logout',
]