[rewrite] Changes services to crud, modified routes abit
This commit is contained in:
1 parent
543aadf521
commit
f5547be799
21 files changed
+126
-29
No files matched your search
@@ -6,11 +6,14 @@ from fastapi.security import OAuth2PasswordRequestForm
|
||||
|
||||
from app.api.dependencies import SessionDep
|
||||
|
||||
from app.schemas.user_schemas import Token
|
||||
|
||||
from app.core import security
|
||||
from app.core.config import settings
|
||||
|
||||
from app.schemas.user_schemas import Token
|
||||
|
||||
from app.crud import user_crud
|
||||
|
||||
|
||||
router = APIRouter(tags=["login"])
|
||||
|
||||
|
||||
@@ -22,9 +25,9 @@ def login_access_token(
|
||||
OAuth2 compatible token login, get an access token for future requests
|
||||
"""
|
||||
user = None
|
||||
# user = crud.authenticate(
|
||||
# session=session, email=form_data.username, password=form_data.password
|
||||
# )
|
||||
user = user_crud.authenticate(
|
||||
session=session, email=form_data.username, password=form_data.password, shop_id=None
|
||||
)
|
||||
if not user:
|
||||
raise HTTPException(status_code=400, detail="Incorrect email or password")
|
||||
elif not user:
|
||||
|
||||
Reference in new issue
Block a user