OAuth flow

don't pass around the function wrapping it. It'll bite you one day, and it's much simpler to require it once at the top of the file and remove useless indentation everywhere