Adds basic auth, login and out buttons, proper redirects and login status on page.