You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# If we have a github team id defined, test that the current user
# is a member of that team.
if data and self.GITHUB_TEAM_ID:
member_url = GITHUB_TEAM_MEMBER_OF_URL.format(
username=data.get('login'),
team_id=self.GITHUB_TEAM_ID,
) + '?' + urlencode({
'access_token': access_token
})
try:
response = dsa_urlopen(member_url)
except HTTPError:
raise AuthFailed(self, 'User doesn\'t belong to the team')
else:
if response.code != 204:
raise AuthFailed('User doesn\'t belong to the team')
I created a working solution with the above code for django-social-auth==0.7.28. If there are more 0.7.* versions planned please add it there as well.
The text was updated successfully, but these errors were encountered:
@ffurrer, I've added an extra github backend, similar to the github-for-organizations backend, but that checks by team instead, the code was so similar that I've added a class to deal with the common code.
I suggest adding something like this to check if a github user is part of a team (similar to check if a user is part of an organization.
And then something like this:
I created a working solution with the above code for
django-social-auth==0.7.28
. If there are more 0.7.* versions planned please add it there as well.The text was updated successfully, but these errors were encountered: