rename REPORT_SECRET env variable to API_SECRET
All checks were successful
delpoy / build-and-deploy (push) Successful in 48s

This commit is contained in:
2024-12-01 14:48:43 +01:00
parent 06751f0e27
commit 5e07f4d545
4 changed files with 6 additions and 5 deletions

View File

@ -7,7 +7,7 @@ import type { CreationAttributes } from 'sequelize';
import { env as public_env } from '$env/dynamic/public';
export const POST = (async ({ request, url }) => {
if (env.REPORT_SECRET && url.searchParams.get('secret') !== env.REPORT_SECRET)
if (env.API_SECRET && url.searchParams.get('secret') !== env.API_SECRET)
return new Response(null, { status: 401 });
const parseResult = await FeedbackAddSchema.safeParseAsync(await request.json());

View File

@ -6,7 +6,7 @@ import { env } from '$env/dynamic/private';
import { ReportAddSchema } from './schema';
export const GET = (async ({ url }) => {
if (env.REPORT_SECRET && url.searchParams.get('secret') !== env.REPORT_SECRET)
if (env.API_SECRET && url.searchParams.get('secret') !== env.API_SECRET)
return new Response(null, { status: 401 });
const user = await User.findOne({ where: { uuid: url.searchParams.get('uuid') ?? '' } });
@ -55,7 +55,7 @@ export const GET = (async ({ url }) => {
}) satisfies RequestHandler;
export const POST = (async ({ request, url }) => {
if (env.REPORT_SECRET && url.searchParams.get('secret') !== env.REPORT_SECRET)
if (env.API_SECRET && url.searchParams.get('secret') !== env.API_SECRET)
return new Response(null, { status: 401 });
const parseResult = await ReportAddSchema.safeParseAsync(await request.json());

View File

@ -4,7 +4,7 @@ import { env } from '$env/dynamic/private';
import { Op } from 'sequelize';
export const GET = (async ({ url }) => {
if (env.REPORT_SECRET && url.searchParams.get('secret') !== env.REPORT_SECRET)
if (env.API_SECRET && url.searchParams.get('secret') !== env.API_SECRET)
return new Response(null, { status: 401 });
const uuid = url.searchParams.get('uuid');