autocommit 22-07-2024-15-38
This commit is contained in:
parent
3ff6c55fad
commit
f05da08ac8
|
|
@ -61,7 +61,7 @@ async def get_current_user(token: str = Depends(oauth2_scheme)):
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM])
|
payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM])
|
||||||
username: str = payload.get("sub")
|
username = payload.get("sub")
|
||||||
if username is None:
|
if username is None:
|
||||||
raise credentials_exception
|
raise credentials_exception
|
||||||
token_data = TokenData(username=username)
|
token_data = TokenData(username=username)
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@ from fastapi import FastAPI
|
||||||
from .routers import items, orders, users
|
from .routers import items, orders, users
|
||||||
|
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
# Initialize database
|
|
||||||
# init_db()
|
|
||||||
|
|
||||||
# Include routers
|
# Include routers
|
||||||
app.include_router(items.router)
|
app.include_router(items.router)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue