fix: email sending and recommendation

* use token in the custom header as the key in rate limiter
This commit is contained in:
Hongbo Wu
2023-06-28 17:00:11 +08:00
parent e0c59434d7
commit b7c133d58e
5 changed files with 39 additions and 37 deletions

View File

@ -12,7 +12,7 @@ import {
CreateLabelInput,
} from '../generated/graphql'
import { signFeatureToken } from '../services/features'
import { generateVerificationToken } from './auth'
import { generateVerificationToken, OmnivoreAuthorizationHeader } from './auth'
import { CreateTaskError } from './errors'
import { buildLogger } from './logger'
import View = google.cloud.tasks.v2.Task.View
@ -432,7 +432,7 @@ export const enqueueRecommendation = async (
}
const headers = {
Cookie: `auth=${authToken}`,
[OmnivoreAuthorizationHeader]: authToken,
}
// If there is no Google Cloud Project Id exposed, it means that we are in local environment
if (env.dev.isLocal || !GOOGLE_CLOUD_PROJECT) {