mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03:00
Fixed limit service not allowing explore integration
no issue - Don't run limit checks for the Ghost Explore integration
This commit is contained in:
parent
f34740d6d0
commit
fd9e19ce07
@ -127,7 +127,11 @@ const authenticateWithToken = async (req, res, next, {token, JWT_OPTIONS}) => {
|
||||
|
||||
// CASE: blocking all non-internal: "custom" and "builtin" integration requests when the limit is reached
|
||||
if (limitService.isLimited('customIntegrations')
|
||||
&& (apiKey.relations.integration && !['internal'].includes(apiKey.relations.integration.get('type')))) {
|
||||
&& (apiKey.relations.integration
|
||||
&& !['internal'].includes(apiKey.relations.integration.get('type'))
|
||||
&& !['ghost-explore'].includes(apiKey.relations.integration.get('slug'))
|
||||
)
|
||||
) {
|
||||
// NOTE: using "checkWouldGoOverLimit" instead of "checkIsOverLimit" here because flag limits don't have
|
||||
// a concept of measuring if the limit has been surpassed
|
||||
await limitService.errorIfWouldGoOverLimit('customIntegrations');
|
||||
|
@ -43,7 +43,11 @@ const authenticateContentApiKey = async function authenticateContentApiKey(req,
|
||||
|
||||
// CASE: blocking all non-internal: "custom" and "builtin" integration requests when the limit is reached
|
||||
if (limitService.isLimited('customIntegrations')
|
||||
&& (apiKey.relations.integration && !['internal'].includes(apiKey.relations.integration.get('type')))) {
|
||||
&& (apiKey.relations.integration
|
||||
&& !['internal'].includes(apiKey.relations.integration.get('type'))
|
||||
&& !['ghost-explore'].includes(apiKey.relations.integration.get('slug'))
|
||||
)
|
||||
) {
|
||||
// NOTE: using "checkWouldGoOverLimit" instead of "checkIsOverLimit" here because flag limits don't have
|
||||
// a concept of measuring if the limit has been surpassed
|
||||
await limitService.errorIfWouldGoOverLimit('customIntegrations');
|
||||
|
Loading…
Reference in New Issue
Block a user