B: Update access token shenanigains

This commit is contained in:
Preston Baxter 2023-11-24 14:44:34 -06:00
parent df13793d22
commit 268cd3d1b2
1 changed files with 2 additions and 2 deletions

View File

@ -33,7 +33,7 @@ func (ts *VendorTokenSource) Token() (*oauth2.Token, error) {
//Define lock
token_lock := &models.TokenLock{
VendorId: ts.vendor.MongoId(),
TokenId: ts.vendor.OauthCredentials.RefreshToken,
TokenId: ts.vendor.OauthCredentials.AccessToken,
Refreshed: false,
}
//Don't forget to create the mongo id
@ -72,7 +72,7 @@ func (ts *VendorTokenSource) Token() (*oauth2.Token, error) {
}
//update vendor
ts.vendor.OauthCredentials.RefreshToken = token.RefreshToken
ts.vendor.OauthCredentials.AccessToken = token.AccessToken
//save vendor
err = ts.db.SaveModel(ts.vendor)