Doing so was a sin.
1- Sincerely regret it and ask Allah to forgive you
2- Do a good deed like paying charity and gift to that person who was exposed, and ask Allah to forgive you for what you did and to help that person for encountering any difficulties that were caused by it