Login flow and handling the sign in and sign up result codes