Skip to content

Commit

Permalink
Add only .env.CRON_SECRET to the condition
Browse files Browse the repository at this point in the history
  • Loading branch information
sidiDev committed Dec 18, 2023
1 parent 1f311fe commit 784f9c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions app/api/comment-notification/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ async function sendNotification(email: string, slug: string, product_name: strin
}

export async function GET(request: NextRequest) {
const authHeader = request.headers.get('authorization');
if (authHeader !== `Bearer ${process.env.CRON_SECRET}`) {
if (!process.env.CRON_SECRET) {
return new Response('Unauthorized', {
status: 401,
});
Expand Down
3 changes: 1 addition & 2 deletions app/api/upvote-notification/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ async function sendNotification(email: string, slug: string, product_name: strin
}

export async function GET(request: NextRequest) {
const authHeader = request.headers.get('authorization');
if (authHeader !== `Bearer ${process.env.CRON_SECRET}`) {
if (!process.env.CRON_SECRET) {
return new Response('Unauthorized', {
status: 401,
});
Expand Down

0 comments on commit 784f9c3

Please sign in to comment.