If you are in the main page, he need to login.

If you in the main page, you need to log in. If you're on the main page and logged in you see something if you're on the main page and not logged in you see a login link