Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
dex
Commits
b84721cb
Commit
b84721cb
authored
Aug 17, 2017
by
Eric Stroczynski
Committed by
GitHub
Aug 17, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1035 from estroz/user-login-github-patch
connector/github: fix username used when making API requests
parents
7e580ec2
484327fd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
github.go
connector/github/github.go
+6
-6
No files found.
connector/github/github.go
View file @
b84721cb
...
...
@@ -247,16 +247,16 @@ func (c *githubConnector) HandleCallback(s connector.Scopes, r *http.Request) (i
if
s
.
Groups
{
var
groups
[]
string
if
len
(
c
.
orgs
)
>
0
{
if
groups
,
err
=
c
.
listGroups
(
ctx
,
client
,
user
name
);
err
!=
nil
{
if
groups
,
err
=
c
.
listGroups
(
ctx
,
client
,
user
.
Login
);
err
!=
nil
{
return
identity
,
err
}
}
else
if
c
.
org
!=
""
{
inOrg
,
err
:=
c
.
userInOrg
(
ctx
,
client
,
user
name
,
c
.
org
)
inOrg
,
err
:=
c
.
userInOrg
(
ctx
,
client
,
user
.
Login
,
c
.
org
)
if
err
!=
nil
{
return
identity
,
err
}
if
!
inOrg
{
return
identity
,
fmt
.
Errorf
(
"github: user %q not a member of org %q"
,
user
name
,
c
.
org
)
return
identity
,
fmt
.
Errorf
(
"github: user %q not a member of org %q"
,
user
.
Login
,
c
.
org
)
}
if
groups
,
err
=
c
.
teams
(
ctx
,
client
,
c
.
org
);
err
!=
nil
{
return
identity
,
fmt
.
Errorf
(
"github: get teams: %v"
,
err
)
...
...
@@ -303,16 +303,16 @@ func (c *githubConnector) Refresh(ctx context.Context, s connector.Scopes, ident
if
s
.
Groups
{
var
groups
[]
string
if
len
(
c
.
orgs
)
>
0
{
if
groups
,
err
=
c
.
listGroups
(
ctx
,
client
,
user
name
);
err
!=
nil
{
if
groups
,
err
=
c
.
listGroups
(
ctx
,
client
,
user
.
Login
);
err
!=
nil
{
return
identity
,
err
}
}
else
if
c
.
org
!=
""
{
inOrg
,
err
:=
c
.
userInOrg
(
ctx
,
client
,
user
name
,
c
.
org
)
inOrg
,
err
:=
c
.
userInOrg
(
ctx
,
client
,
user
.
Login
,
c
.
org
)
if
err
!=
nil
{
return
identity
,
err
}
if
!
inOrg
{
return
identity
,
fmt
.
Errorf
(
"github: user %q not a member of org %q"
,
user
name
,
c
.
org
)
return
identity
,
fmt
.
Errorf
(
"github: user %q not a member of org %q"
,
user
.
Login
,
c
.
org
)
}
if
groups
,
err
=
c
.
teams
(
ctx
,
client
,
c
.
org
);
err
!=
nil
{
return
identity
,
fmt
.
Errorf
(
"github: get teams: %v"
,
err
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment