mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-18 16:32:43 +00:00
Merge branch 'master' into dependabot/npm_and_yarn/globals-15.14.0
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import {model as HomebrewModel } from './homebrew.model.js';
|
import { model as HomebrewModel } from './homebrew.model.js';
|
||||||
import {model as NotificationModel } from './notifications.model.js';
|
import { model as NotificationModel } from './notifications.model.js';
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
import Moment from 'moment';
|
import Moment from 'moment';
|
||||||
import zlib from 'zlib';
|
import zlib from 'zlib';
|
||||||
@@ -108,6 +108,9 @@ router.put('/admin/clean/script/:id', asyncHandler(HomebrewAPI.getBrew('admin',
|
|||||||
|
|
||||||
req.body = brew;
|
req.body = brew;
|
||||||
|
|
||||||
|
// Remove Account from request to prevent Admin user from being added to brew as an Author
|
||||||
|
req.account = undefined;
|
||||||
|
|
||||||
return await HomebrewAPI.updateBrew(req, res);
|
return await HomebrewAPI.updateBrew(req, res);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -122,10 +122,10 @@ const api = {
|
|||||||
throw { HBErrorCode: '51', code: stub?.lock.code, message: stub?.lock.shareMessage, brewId: stub?.shareId, brewTitle: stub?.title };
|
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 there's a google id, get it if requesting the full brew or if no stub found yet
|
||||||
if(!stubOnly && googleId) {
|
if(googleId && (!stubOnly || !stub)) {
|
||||||
const oAuth2Client = isOwner ? GoogleActions.authCheck(req.account, res) : undefined;
|
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)
|
const googleBrew = await GoogleActions.getGoogleBrew(oAuth2Client, googleId, id, accessType)
|
||||||
.catch((googleError)=>{
|
.catch((googleError)=>{
|
||||||
const reason = googleError.errors?.[0].reason;
|
const reason = googleError.errors?.[0].reason;
|
||||||
|
|||||||
Reference in New Issue
Block a user