How can I change the author of a post? I dont want to use the dashboard.

My site has 20 posts inside a custom post type written by the admin. I want to change the author of the post to the logged in user, when a user logs in and they can claim the post. I don't want to change through the admin dashboard. I want the user to choose the post they want to edit and become the owner of that post.