The Messenger of Allah ﷺ used to say in his supplication, "O Allah, grant me Your love and the love of those whose love benefits me with You. O Allah, whatever You provide me of what I love, make it a strength for me in what You love. O Allah, and whatever You withhold from me of what I love, make it a freedom for me to pursue what You love."
حدثنا سفيان بن وكيع حدثنا ابن أبي عدي عن حماد بن سلمة عن أبي جعفر الخطمي عن محمد بن كعب القرظي
عن رسول الله ﷺ أنه كان يقول في دعائه اللهم ارزقني حبك وحب من ينفعني حبه عندك اللهم ما رزقتني مما أحب فاجعله قوة لي فيما تحب اللهم وما زويت عني مما أحب فاجعله فراغا لي فيما تحب
[Its isnad is daif]. Ibn Mubarak also reported it in Zuhd, no. 430, from Hammad bin Salama with the same wording, and said, "I think he attributed it to the Prophet." Sufyan bin Waki is daif, most scholars have declared him daif.