Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
id
go-sso
Commits
bef0bea2
Commit
bef0bea2
authored
Oct 29, 2018
by
ale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve logging for exchange failures
parent
d3b43e35
Pipeline
#1423
passed with stages
in 1 minute and 53 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
server/http.go
server/http.go
+7
-2
No files found.
server/http.go
View file @
bef0bea2
...
...
@@ -290,8 +290,13 @@ func (h *Server) handleExchange(w http.ResponseWriter, req *http.Request) {
reqGroups
:=
strings
.
Split
(
req
.
FormValue
(
"new_groups"
),
","
)
token
,
err
:=
h
.
loginService
.
Exchange
(
curToken
,
curService
,
curNonce
,
newService
,
newNonce
,
reqGroups
)
if
err
!=
nil
{
log
.
Printf
(
"exchange error: %v"
,
err
)
switch
{
case
err
==
ErrUnauthorized
:
log
.
Printf
(
"unauthorized exchange request (%s -> %s)"
,
curService
,
newService
)
http
.
Error
(
w
,
"Forbidden"
,
http
.
StatusForbidden
)
return
case
err
!=
nil
:
log
.
Printf
(
"exchange error (%s -> %s): %v"
,
curService
,
newService
,
err
)
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
return
}
...
...
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