Working on LoginPage tests
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -27,8 +27,10 @@ DEFAULT_SKIP_PATTERNS = [
|
||||
r'.*\.css',
|
||||
r'.*\.js',
|
||||
'/login',
|
||||
'/login2',
|
||||
'/login-p',
|
||||
'/register',
|
||||
'/register-p',
|
||||
'/logout',
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user