Refactor authentication and session management
- Removed session-based user retrieval from dependencies.py and main.py. - Eliminated SessionMiddleware and related session handling code. - Updated dashboard and team views to directly query user data from the database. - Simplified redeem and team management views to remove authentication checks. - Adjusted templates to reflect changes in user context handling. - Added camera selection feature in scan_qr.html for improved QR code scanning. - Cleaned up Docker configuration and requirements for better deployment.
This commit is contained in:
+6
-1
@@ -6,10 +6,15 @@ import random
|
||||
from datetime import datetime, timedelta
|
||||
from sqlalchemy import inspect
|
||||
from sqlalchemy.orm import Session
|
||||
from passlib.context import CryptContext
|
||||
|
||||
from .models import User, Team, TeamMembership, QRTicket
|
||||
from .db import SessionLocal
|
||||
from .auth import get_password_hash
|
||||
|
||||
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
|
||||
|
||||
def get_password_hash(password: str) -> str:
|
||||
return pwd_context.hash(password)
|
||||
|
||||
def table_has_column(engine, table_name, column_name):
|
||||
"""Check if a table has a specific column."""
|
||||
|
||||
Reference in New Issue
Block a user