add operation log

This commit is contained in:
2025-02-01 14:23:43 +09:00
parent 160367f91b
commit b502a3ba8f
5 changed files with 63 additions and 44 deletions

View File

@@ -9,7 +9,7 @@ from app.core import security
from app.db.cruddb import userService
from app.core.dbmanager import get_db
async def get_current_user(security_scopes: SecurityScopes,
async def get_current_user(request: Request,security_scopes: SecurityScopes,
db=Depends(get_db), token: str = Depends(security.oauth2_scheme)
):
credentials_exception = HTTPException(
@@ -42,6 +42,7 @@ async def get_current_user(security_scopes: SecurityScopes,
user = userService.get_user(db, token_data.id)
if user is None:
raise credentials_exception
request.state.user = user
return user
async def get_current_active_user(