Log in working

After much weirdly tired work, log in now works and is protected.