(venv) G:\projects\python\fastprojects>pip list
python-dateutil 2.8.1
python-multipart 0.0.5
rope 0.17.0
@app.post('/token', tags=['safe'])
async def login(form_data: OAuth2PasswordRequestForm = Depends()):
print('form_data', form_data)
user_dict = fake_users_db.get(form_data.username)
if not user_dict:
raise HTTPException(
status_code=400,
detail='Incorrect username or password'
)
user = UserInDB(**user_dict)
hashed_password = fake_hash_password(form_data.password)
if not hashed_password == user.hashed_password:
raise HTTPException(
status_code=400,
detail='Incorrect username or password'
)
return {'access_token': user.username, 'token_type': 'bearer'}
I don't know how to troubleshoot this problem