Login function moved to LoginApp