Spaces:
Sleeping
Sleeping
fix authen
Browse files
auth.py
CHANGED
|
@@ -10,7 +10,7 @@ from typing import Annotated, Optional
|
|
| 10 |
from jwt.exceptions import InvalidTokenError
|
| 11 |
|
| 12 |
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
|
| 13 |
-
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
|
| 14 |
|
| 15 |
# Authentication helper functions
|
| 16 |
def verify_password(plain_password, hashed_password):
|
|
|
|
| 10 |
from jwt.exceptions import InvalidTokenError
|
| 11 |
|
| 12 |
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
|
| 13 |
+
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="/token")
|
| 14 |
|
| 15 |
# Authentication helper functions
|
| 16 |
def verify_password(plain_password, hashed_password):
|
main.py
CHANGED
|
@@ -52,7 +52,7 @@ app = FastAPI(
|
|
| 52 |
|
| 53 |
# Include Routers
|
| 54 |
app.include_router(health.router, tags=["Health"])
|
| 55 |
-
app.include_router(auth.router, tags=["Authentication"])
|
| 56 |
app.include_router(predict.router, tags=["AI Model"])
|
| 57 |
|
| 58 |
|
|
|
|
| 52 |
|
| 53 |
# Include Routers
|
| 54 |
app.include_router(health.router, tags=["Health"])
|
| 55 |
+
app.include_router(auth.router, tags=["Authentication"], prefix="")
|
| 56 |
app.include_router(predict.router, tags=["AI Model"])
|
| 57 |
|
| 58 |
|