-
Notifications
You must be signed in to change notification settings - Fork 0
add: zustand store for call created #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| export declare const ENV: { | ||
| PORT: number; | ||
| DB_URL: string; | ||
| NODE_ENV: "DEVELOPMENT" | "TEST" | "production"; | ||
| NODE_ENV: "development" | "TEST" | "production"; | ||
| JWT_SECRET: string; | ||
| }; | ||
| //# sourceMappingURL=env.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,7 +8,7 @@ export const generateToken = (id:string, res:Response) => { | |||||||||
| res.cookie("jwt", token, { | ||||||||||
| maxAge: 7*24*60*60*1000, //the age for cookie's lifetime must be in ms | ||||||||||
| httpOnly: true, | ||||||||||
| sameSite: "none", | ||||||||||
| sameSite: "lax", | ||||||||||
| secure: ENV.NODE_ENV === "production", | ||||||||||
|
Comment on lines
+11
to
12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Read-only verification: confirm whether production is cross-site and whether cookie policy matches it.
set -e
echo "== Backend CORS origins =="
rg -n --type=ts 'origin:|credentials:' backend/src/app.ts
echo
echo "== Frontend API base URL config =="
rg -n --type=ts 'VITE_API_BASE_URL|baseURL|withCredentials' frontend/src/lib/axios.ts
echo
echo "== JWT cookie settings (set + clear) =="
rg -n --type=ts 'res\.cookie\("jwt"|sameSite|secure|httpOnly' backend/src/utils/generateToken.ts backend/src/controllers/auth.controllers.ts
echo
echo "Expected:"
echo "- If frontend domain and API domain differ by site, prefer SameSite=None + Secure in production."
echo "- If same-site, Lax can work."Repository: shiv7shukla/sect Length of output: 1073
In production, frontend ( Additionally, the logout endpoint in Suggested fixIn res.cookie("jwt", token, {
maxAge: 7*24*60*60*1000,
httpOnly: true,
- sameSite: "lax",
+ sameSite: ENV.NODE_ENV === "production" ? "none" : "lax",
secure: ENV.NODE_ENV === "production",
})In - res.cookie("jwt", "", {maxAge: 0, httpOnly: true, secure: ENV.NODE_ENV === "production", sameSite: "strict"});
+ res.cookie("jwt", "", {maxAge: 0, httpOnly: true, secure: ENV.NODE_ENV === "production", sameSite: ENV.NODE_ENV === "production" ? "none" : "lax"});📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
| }) | ||||||||||
|
|
||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: shiv7shukla/sect
Length of output: 5644
🏁 Script executed:
Repository: shiv7shukla/sect
Length of output: 42
🏁 Script executed:
Repository: shiv7shukla/sect
Length of output: 42
🏁 Script executed:
Repository: shiv7shukla/sect
Length of output: 42
🏁 Script executed:
Repository: shiv7shukla/sect
Length of output: 449
🏁 Script executed:
Repository: shiv7shukla/sect
Length of output: 42
🏁 Script executed:
Repository: shiv7shukla/sect
Length of output: 568
🏁 Script executed:
Repository: shiv7shukla/sect
Length of output: 42
🏁 Script executed:
Repository: shiv7shukla/sect
Length of output: 296
Normalize
NODE_ENVenum to lowercase convention; uppercase "TEST" is not used.The enum currently defines
"TEST"(uppercase) but no code checks for it—allNODE_ENVcomparisons only check=== "production". While the repository has no test infrastructure currently, normalizing to lowercase"test"aligns with Node.js conventions and future-proofs against typical test runner setups that would expectNODE_ENV=test.🛠️ Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents