🐛 Fixed output of register (user_id missing)
continuous-integration/drone/push Build is passing Details

master
Alix JEUDI--LEMOINE 5 months ago
parent dd9c6a0024
commit 9803156d47

@ -94,12 +94,12 @@ async def register(user: UserRegisterDTO):
) )
hashed_password = get_password_hash(user.password) hashed_password = get_password_hash(user.password)
users_collection.insert_one({"username": user.username, "password": hashed_password}) user_id = users_collection.insert_one({"username": user.username, "password": hashed_password})
access_token_expires = timedelta(minutes=ACCESS_TOKEN_EXPIRE_MINUTES) access_token_expires = timedelta(minutes=ACCESS_TOKEN_EXPIRE_MINUTES)
access_token = create_access_token(data={"sub": user.username}, expires_delta=access_token_expires) access_token = create_access_token(data={"sub": user.username}, expires_delta=access_token_expires)
return {"access_token": access_token, "token_type": "bearer", "user_id": str(user["_id"])} return {"access_token": access_token, "token_type": "bearer", "user_id": str(user_id)}
@app.post( @app.post(
path="/login", path="/login",

Loading…
Cancel
Save