set up login flow and logic