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:
parent
06751f0e27
commit
5e07f4d545
@ -1,10 +1,11 @@
|
|||||||
DATABASE_URI=sqlite://./database.db
|
DATABASE_URI=sqlite://./database.db
|
||||||
ADMIN_USER=admin
|
ADMIN_USER=admin
|
||||||
ADMIN_PASSWORD=admin
|
ADMIN_PASSWORD=admin
|
||||||
REPORT_SECRET=
|
|
||||||
PUBLIC_START_DATE=2023-12-26T00:00:00+0200
|
PUBLIC_START_DATE=2023-12-26T00:00:00+0200
|
||||||
PUBLIC_BASE_PATH=
|
PUBLIC_BASE_PATH=
|
||||||
|
|
||||||
|
API_SECRET=
|
||||||
|
|
||||||
PUBLIC_SERVER_IP=example.com
|
PUBLIC_SERVER_IP=example.com
|
||||||
PUBLIC_TS_LINK=ts3server://example.com
|
PUBLIC_TS_LINK=ts3server://example.com
|
||||||
PUBLIC_DISCORD_LINK=https://example.com
|
PUBLIC_DISCORD_LINK=https://example.com
|
||||||
|
@ -7,7 +7,7 @@ import type { CreationAttributes } from 'sequelize';
|
|||||||
import { env as public_env } from '$env/dynamic/public';
|
import { env as public_env } from '$env/dynamic/public';
|
||||||
|
|
||||||
export const POST = (async ({ request, url }) => {
|
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 });
|
return new Response(null, { status: 401 });
|
||||||
|
|
||||||
const parseResult = await FeedbackAddSchema.safeParseAsync(await request.json());
|
const parseResult = await FeedbackAddSchema.safeParseAsync(await request.json());
|
||||||
|
@ -6,7 +6,7 @@ import { env } from '$env/dynamic/private';
|
|||||||
import { ReportAddSchema } from './schema';
|
import { ReportAddSchema } from './schema';
|
||||||
|
|
||||||
export const GET = (async ({ url }) => {
|
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 });
|
return new Response(null, { status: 401 });
|
||||||
|
|
||||||
const user = await User.findOne({ where: { uuid: url.searchParams.get('uuid') ?? '' } });
|
const user = await User.findOne({ where: { uuid: url.searchParams.get('uuid') ?? '' } });
|
||||||
@ -55,7 +55,7 @@ export const GET = (async ({ url }) => {
|
|||||||
}) satisfies RequestHandler;
|
}) satisfies RequestHandler;
|
||||||
|
|
||||||
export const POST = (async ({ request, url }) => {
|
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 });
|
return new Response(null, { status: 401 });
|
||||||
|
|
||||||
const parseResult = await ReportAddSchema.safeParseAsync(await request.json());
|
const parseResult = await ReportAddSchema.safeParseAsync(await request.json());
|
||||||
|
@ -4,7 +4,7 @@ import { env } from '$env/dynamic/private';
|
|||||||
import { Op } from 'sequelize';
|
import { Op } from 'sequelize';
|
||||||
|
|
||||||
export const GET = (async ({ url }) => {
|
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 });
|
return new Response(null, { status: 401 });
|
||||||
|
|
||||||
const uuid = url.searchParams.get('uuid');
|
const uuid = url.searchParams.get('uuid');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user