Spaces:
Runtime error
Runtime error
Pushing solution to bug
Browse filesFiles changed (2)
- src/auth.py+2-2
- src/routers/token.py+1-3
119 unmodified lines1201211221231241251262 unmodified lines129130131132133134135119 unmodified linesreturn device_ormasync def authenticate_user(username: str,password: str,db: SQLAlchemySessionType = Depends(get_db)2 unmodified linesAuthenticates a user by username and password.Returns the ORM User model if successful, raises HTTPException otherwise."""user = await run_in_threadpool(crud.get_user_by_username, db, username)if not user:return None # User not found, return None119 unmodified lines1201211221231241251262 unmodified lines129130131132133134135119 unmodified linesreturn device_ormdef authenticate_user(username: str,password: str,db: SQLAlchemySessionType = Depends(get_db)2 unmodified linesAuthenticates a user by username and password.Returns the ORM User model if successful, raises HTTPException otherwise."""user = crud.get_user_by_username(db, username)if not user:return None # User not found, return None
27 unmodified lines28293031323334353627 unmodified linesThis is the primary login endpoint. It takes a username and passwordand returns an access token if the credentials are valid."""user = await run_in_threadpool(authenticate_user, db, form_data.username, form_data.password)if not user:raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED,27 unmodified lines2829303132333427 unmodified linesThis is the primary login endpoint. It takes a username and passwordand returns an access token if the credentials are valid."""user = authenticate_user(db, form_data.username, form_data.password)if not user:raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED,
src/auth.py+2-2
src/routers/token.py+1-3