From 65167c3e58b60fb73a5003664ec7aa1c56949e83 Mon Sep 17 00:00:00 2001 From: Preston Baxter Date: Sat, 4 Nov 2023 18:38:20 -0500 Subject: [PATCH] B: Append last commit --- ui/controllers/youtube.go | 1 - ui/db/models/vendor.go | 7 ------- 2 files changed, 8 deletions(-) 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) - } -}