diff --git a/server/homebrew.api.js b/server/homebrew.api.js index 5f19f81fb..9a479732e 100644 --- a/server/homebrew.api.js +++ b/server/homebrew.api.js @@ -122,10 +122,10 @@ const api = { throw { HBErrorCode: '51', code: stub?.lock.code, message: stub?.lock.shareMessage, brewId: stub?.shareId, brewTitle: stub?.title }; } - // If there is a google id, try to find the google brew - if(!stubOnly && googleId) { + // If there's a google id, get it if requesting the full brew or if no stub found yet + if(googleId && (!stubOnly || !stub)) { const oAuth2Client = isOwner ? GoogleActions.authCheck(req.account, res) : undefined; - console.log(`user ${req.account?.username} attempting to get googlebrew ${googleId} as ${isOwner ? 'owner' : 'visitor'}`); + const googleBrew = await GoogleActions.getGoogleBrew(oAuth2Client, googleId, id, accessType) .catch((googleError)=>{ const reason = googleError.errors?.[0].reason;