added login logic and routing