add operation log
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user