rename REPORT_SECRET env variable to API_SECRET
All checks were successful
delpoy / build-and-deploy (push) Successful in 48s
All checks were successful
delpoy / build-and-deploy (push) Successful in 48s
This commit is contained in:
@ -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());
|
||||
|
@ -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());
|
||||
|
@ -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');
|
||||
|
Reference in New Issue
Block a user