Revert "Revert "Fix login so it knows what BASEPAGE is""

This reverts commit 8c948d8b807d37ef674e950def517050144dc117.