passes in redirect_uri to remove duplicate code