The Messenger of Allah ﷺ said, "People will be resurrected according to their intentions."
حدثنا زهير بن محمد أنبأنا زكريا بن عدي أنبأنا شريك عن الأعمش عن أبي سفيان
قال رسول الله ﷺ يحشر الناس على نياتهم
No references are available.
Muslim reported it in the Book of Paradise and its Bliss, chapter on the command to have good expectation of Allah at the time of death, hadith 83/2878, from the hadith of Amash with this chain, with the wording, "Every servant will be raised in the state in which he died," and with this the hadith is confirmed as sahih.