Reduce duplication in GitHub auth code