From 5d10e7b2e85b89cb087493279d9c5c9420f0b1e2 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Thu, 24 Nov 2022 15:16:06 +0100 Subject: Util: Get rid of current time helper Fixes #5 --- internal/oauth/oauth.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'internal/oauth') diff --git a/internal/oauth/oauth.go b/internal/oauth/oauth.go index 4bccdf5..9518d79 100644 --- a/internal/oauth/oauth.go +++ b/internal/oauth/oauth.go @@ -161,7 +161,7 @@ func (oauth *OAuth) getTokensWithAuthCode(authCode string) error { "content-type": {"application/x-www-form-urlencoded"}, } opts := &httpw.HTTPOptionalParams{Headers: headers, Body: data} - current_time := util.GetCurrentTime() + current_time := time.Now() _, body, bodyErr := httpw.HTTPPostWithOpts(reqURL, opts) if bodyErr != nil { return types.NewWrappedError(errorMessage, bodyErr) @@ -187,7 +187,7 @@ func (oauth *OAuth) getTokensWithAuthCode(authCode string) error { func (oauth *OAuth) isTokensExpired() bool { expired_time := oauth.Token.ExpiredTimestamp - current_time := util.GetCurrentTime() + current_time := time.Now() return !current_time.Before(expired_time) } @@ -205,7 +205,7 @@ func (oauth *OAuth) getTokensWithRefresh() error { "content-type": {"application/x-www-form-urlencoded"}, } opts := &httpw.HTTPOptionalParams{Headers: headers, Body: data} - current_time := util.GetCurrentTime() + current_time := time.Now() _, body, bodyErr := httpw.HTTPPostWithOpts(reqURL, opts) if bodyErr != nil { return types.NewWrappedError(errorMessage, bodyErr) -- cgit v1.2.3