Skip to content

Commit

Permalink
FIX: client credentials expiry is calculated incorrectly (#24)
Browse files Browse the repository at this point in the history
* change expiry to seconds

* change expiry to seconds

---------

Co-authored-by: Ramon Bisswanger <bisswang@adobe.com>
  • Loading branch information
bisswanger and Ramon Bisswanger authored Sep 6, 2023
1 parent dfea7b4 commit 3118bb5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ims/cluster_exchange_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (c *Client) ClusterExchangeWithContext(ctx context.Context, r *ClusterExcha
return &ClusterExchangeResponse{
Response: *res,
AccessToken: body.AccessToken,
ExpiresIn: time.Millisecond * time.Duration(body.ExpiresIn),
ExpiresIn: time.Second * time.Duration(body.ExpiresIn),
}, nil
}

Expand Down
2 changes: 1 addition & 1 deletion ims/cluster_exchange_token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func TestClusterExchange(t *testing.T) {
}{
TokenType: "bearer",
AccessToken: "new-token",
ExpiresIn: 3600000,
ExpiresIn: 3600,
}

if err := json.NewEncoder(w).Encode(&body); err != nil {
Expand Down

0 comments on commit 3118bb5

Please sign in to comment.