Makes sure the credentials are refreshed before resolving the promises