mirror of
https://github.com/Nezumi-2711/next-gdrive-index.git
synced 2026-09-22 13:38:38 +00:00
update: force to use key on production
This commit is contained in:
@@ -11,6 +11,10 @@ export async function GET(request: NextRequest) {
|
|||||||
const key = sp.get("key");
|
const key = sp.get("key");
|
||||||
if (!query) return new NextResponse("Add query parameter 'q' with the value to encrypt", { status: 400 });
|
if (!query) return new NextResponse("Add query parameter 'q' with the value to encrypt", { status: 400 });
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV !== "development" && !key) {
|
||||||
|
throw new Error("Key is required in production environment");
|
||||||
|
}
|
||||||
|
|
||||||
const encrypted = await encryptionService.encrypt(query, key ?? undefined);
|
const encrypted = await encryptionService.encrypt(query, key ?? undefined);
|
||||||
const decrypted = await encryptionService.decrypt(encrypted, key ?? undefined);
|
const decrypted = await encryptionService.decrypt(encrypted, key ?? undefined);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user