All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad, sallallaahu 'alayhi wa sallam, is His slave and Messenger.
The story to which you referred was cited by At-Tustari without a chain of narration. He, may Allaah have mercy upon him, said: “I was informed that there was a very handsome young man during the reign of ‘Umar and he liked and thought well of him (believed him to be righteous). One day, the young man passed by a woman and admired her. When he felt the desire to commit sin with her, he was protected (by Allah) from committing the sin and fell unconscious. The woman had him carried to his house. He had an elderly father who used to wait for him by the door when night fell. Upon seeing him in that condition, he (the father) fainted. When he regained consciousness, his father asked him about his condition, and he told him what had happened. Then the young man let out a gasp and dropped dead. When he was buried, ‘Umar stood by his grave and recited the verse that reads (what means): {But for he who has feared the position of his Lord are two gardens.} [Quran 55: 46] He responded from inside his grave, “Verily, Allah gave them to me plus a third one along with them.” [End of Quote]
The story was also narrated by Al-Bayhaqi in Shu‘ab Al-Eemaan, but he did not mention that the young man spoke after his death. He narrated it with his chain of narration on the authority of Al-Hasan : “There was a young man during the reign of ‘Umar ibn Al-Khattaab who was a frequent visitor of the mosque and devoted to worship. A young lady was infatuated by him, so she came to him once when he was alone and talked to him. He thought of giving in to temptations but immediately gasped and fell unconscious. An uncle of his came and carried him to his house, and when he woke up, he said: ‘O Uncle! Go to ‘Umar, give my greetings to him, and ask him what the reward of someone who fears the position of his Lord is.’ His uncle set out and asked ‘Umar. Meanwhile, the young man let out another gasp and died. ‘Umar stood by his body and said: ‘You will be given two gardens. You will be given two gardens.’” [End of Quote]
The narration is inauthentic.
Allah knows best.