Skip to content

Commit

Permalink
add AuthRefreshToken API
Browse files Browse the repository at this point in the history
  • Loading branch information
devang-gaur committed Aug 2, 2024
1 parent beda3cc commit 59f773c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions client/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ func (h *V1Client) Authenticate(body *models.V1AuthLogin) (*models.V1UserToken,
return resp.Payload, nil
}

// AuthRefreshToken refreshes jwt token.
func (h *V1Client) AuthRefreshToken(token string) (*models.V1UserToken, error) {
params := clientv1.NewV1AuthRefreshParamsWithContext(h.ctx).WithToken(token)
resp, err := h.Client.V1AuthRefresh(params)
if err != nil {
return nil, err
}
return resp.Payload, nil
}

// GetUsersInfo retrieves the authenticated user info.
func (h *V1Client) GetUsersInfo() (*models.V1UserInfo, error) {
params := clientv1.NewV1UsersInfoGetParamsWithContext(h.ctx)
Expand Down

0 comments on commit 59f773c

Please sign in to comment.