Skip to content

Commit

Permalink
Small tweaks from feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jhendrixMSFT committed Sep 28, 2018
1 parent cc7d4d2 commit 38aa960
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions autorest/adal/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ type RefresherWithContext interface {
type TokenRefreshCallback func(Token) error

// Token encapsulates the access token used to authorize Azure requests.
// https://docs.microsoft.com/en-us/azure/active-directory/develop/v1-oauth2-client-creds-grant-flow#service-to-service-access-token-response
type Token struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
Expand Down
2 changes: 1 addition & 1 deletion autorest/adal/token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ func expireToken(t *Token) *Token {

func setTokenToExpireAt(t *Token, expireAt time.Time) *Token {
t.ExpiresIn = "3600"
t.ExpiresOn = json.Number(strconv.Itoa(int(expireAt.Sub(date.UnixEpoch()).Seconds())))
t.ExpiresOn = json.Number(strconv.FormatInt(int64(expireAt.Sub(date.UnixEpoch())/time.Second), 10))
t.NotBefore = t.ExpiresOn
return t
}
Expand Down

0 comments on commit 38aa960

Please sign in to comment.