Ported Login Page logic.