Use promise resolve to finish authorization