Skip to content

Commit

Permalink
fix(DECRYPTEDDATA): remove extra JSON stringification round
Browse files Browse the repository at this point in the history
  • Loading branch information
phukon committed Mar 14, 2024
1 parent b684293 commit 9c36c0d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
- A vercel cronjob triggers at 0000hrs UTC to set the word-count reference.
- A second cronjob from an EC2 instance triggers at 0530hrs IST or 0000hrs UTC for redundancy.

## Encryption
**Type** : `AES-256-CBC`
- The key should be **32 bytes** or **256 bits** in length!!
- Initialization Vector should be **16 bytes** or **128 bits**.

## Contribution logic
- Update wordcount Ref if a document is removed.
- Missing contributions are showed as blank on the canvas. No need to add blank contribution data to keep contributions array filled with consecutive dates.
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/fetchPosts/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { currentUser } from "@/lib/auth";
import { decryptData } from "@/lib/graph/encryptData";
import { decryptData } from "@/lib/encryptData";

export async function GET(_: Request): Promise<Response> {
const user = await currentUser();
Expand Down
4 changes: 2 additions & 2 deletions src/app/api/note/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { currentUser } from "@/lib/auth";
import { db } from "@/lib/db";
import { exportContentAsText } from "@/lib/extractText";
import { decryptData, encryptData } from "@/lib/graph/encryptData";
import { decryptData, encryptData } from "@/lib/encryptData";

// export const runtime = "edge";

Expand Down Expand Up @@ -124,7 +124,7 @@ export async function GET(req: Request): Promise<Response> {
initVector: process.env.INITIALIZATION_VECTOR!,
});

return new Response(JSON.stringify(DECRYPTEDDATA), {
return new Response(DECRYPTEDDATA, {
status: 200,
});
}
Expand Down
File renamed without changes.

0 comments on commit 9c36c0d

Please sign in to comment.