Thanks for the update! Working correctly for me for the most part. I did find an issues with the redirect after logging in successfully. If your WP install is in a directory then it redirects to "Page Not Found" page.
So if my site is domain.com and the WP path is domain.com/wordpress, upon login it sends me to domain.com/wordpress instead of domain.com.
Also if I try and login from a post to leave a comment, it does not redirect back to the original post.
The Twitter version redirects as you would think it would.