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

fixes #6878
This is already implemented somewhere. Is it possible to just reuse that other code? What if we want to log in with oauth or something?