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
aefdd6e0
Commit
aefdd6e0
authored
Apr 28, 2017
by
rithu john
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server/api: return empty list of refresh tokens if user does not have any
parent
9514bf9a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
api.go
server/api.go
+9
-2
No files found.
server/api.go
View file @
aefdd6e0
...
...
@@ -215,13 +215,20 @@ func (d dexAPI) ListRefresh(ctx context.Context, req *api.ListRefreshReq) (*api.
return
nil
,
err
}
var
refreshTokenRefs
[]
*
api
.
RefreshTokenRef
offlineSessions
,
err
:=
d
.
s
.
GetOfflineSessions
(
id
.
UserId
,
id
.
ConnId
)
if
err
!=
nil
{
d
.
logger
.
Errorf
(
"api: failed to list refresh tokens: %v"
,
err
)
if
err
==
storage
.
ErrNotFound
{
// This means that this user-client pair does not have a refresh token yet.
// An empty list should be returned instead of an error.
return
&
api
.
ListRefreshResp
{
RefreshTokens
:
refreshTokenRefs
,
},
nil
}
d
.
logger
.
Errorf
(
"api: failed to list refresh tokens %t here : %v"
,
err
==
storage
.
ErrNotFound
,
err
)
return
nil
,
err
}
var
refreshTokenRefs
[]
*
api
.
RefreshTokenRef
for
_
,
session
:=
range
offlineSessions
.
Refresh
{
r
:=
api
.
RefreshTokenRef
{
Id
:
session
.
ID
,
...
...
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