diff --git a/ui/controllers/youtube.go b/ui/controllers/youtube.go index e7b802f..f453627 100644 --- a/ui/controllers/youtube.go +++ b/ui/controllers/youtube.go @@ -118,7 +118,6 @@ func ReceiveYoutubeOauth(c *gin.Context) { log.WithError(err).Errorf("Failed to Unmarshal response from the following url: '%s'", token_url.String()) c.AbortWithStatus(502) } - log.Infof("oauthResp: %v", *oauthResp) //Set expires at time but shave some time off to refresh token before expire date oauthResp.ExpiresAt = time.Now().Add(time.Duration(oauthResp.ExpiresIn)*time.Second - 10) diff --git a/ui/db/models/vendor.go b/ui/db/models/vendor.go index 8c6dbce..ce5a295 100644 --- a/ui/db/models/vendor.go +++ b/ui/db/models/vendor.go @@ -1,11 +1,9 @@ package models import ( - "net/http" "time" "go.mongodb.org/mongo-driver/bson/primitive" - "go.mongodb.org/mongo-driver/mongo" ) const VENDOR_ACCOUNT_TYPE = "vendor_account" @@ -44,8 +42,3 @@ func (va *VendorAccount) UpdateObjectInfo() { va.UpdatedAt = now } -func (va *VendorAccount) MakeRequest(req *http.Request, db *mongo.Client) error { - if va.OauthCredentials.ExpiresAt.Before(time.Now()) { - va.OauthCredentials.RefreshAccessToken(va.Name) - } -}