fix: Ensure GitHub OAuth2 users are active in organization (#4416)

This commit is contained in:
Mathias Fredriksson
2022-10-07 19:53:58 +03:00
committed by GitHub
parent e8e095e2f8
commit adcf8838d2
2 changed files with 50 additions and 0 deletions
+3
View File
@@ -65,6 +65,9 @@ func (api *API) userOAuth2Github(rw http.ResponseWriter, r *http.Request) {
}
var selectedMembership *github.Membership
for _, membership := range memberships {
if membership.GetState() != "active" {
continue
}
for _, allowed := range api.GithubOAuth2Config.AllowOrganizations {
if *membership.Organization.Login != allowed {
continue