set up sign in logic to redirect before and after sign in and out