fix(login): also allow login by email in maintenance mode

fixes #6878
But this duplicates code that already exists elsewhere. That is asking for trouble. Can we figure out a way to share the other login code?