Fixed wrong base url used by the auth API
This commit is contained in:
@@ -18,7 +18,7 @@ from ..auth.utils import (
|
||||
)
|
||||
|
||||
|
||||
def setup_auth_routes(app, rt, mount_auth_app=True, sqlite_db_path="Users.db"):
|
||||
def setup_auth_routes(app, rt, mount_auth_app=True, sqlite_db_path="Users.db", base_url=None):
|
||||
"""
|
||||
Setup all authentication and protected routes.
|
||||
|
||||
@@ -27,6 +27,7 @@ def setup_auth_routes(app, rt, mount_auth_app=True, sqlite_db_path="Users.db"):
|
||||
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
|
||||
base_url: Base URL for the application (default to localhost:5001 if not provided)
|
||||
"""
|
||||
|
||||
# ============================================================================
|
||||
@@ -61,7 +62,7 @@ def setup_auth_routes(app, rt, mount_auth_app=True, sqlite_db_path="Users.db"):
|
||||
RedirectResponse on success, or LoginPage with error on failure
|
||||
"""
|
||||
# Attempt login
|
||||
auth_data = login_user(email, password)
|
||||
auth_data = login_user(email, password, base_url=base_url)
|
||||
|
||||
if auth_data:
|
||||
# Login successful - store tokens in session
|
||||
|
||||
Reference in New Issue
Block a user