This question already has an answer here:
- Check if wp-login is current page 9 answers
There are functions for
What's the best way to tell if I'm on a page that is requesting that I login? I guess that would just be the wp-login.php page.