chore: make cookie secure flag conditional for development and add pnpm store to gitignore
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,6 +1,7 @@
|
|||||||
# dependencies
|
# dependencies
|
||||||
node_modules
|
node_modules
|
||||||
.pnpm-debug.log*
|
.pnpm-debug.log*
|
||||||
|
.pnpm-store/
|
||||||
|
|
||||||
# next.js
|
# next.js
|
||||||
.next/
|
.next/
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
"@mintel/husky-config": "workspace:*",
|
"@mintel/husky-config": "workspace:*",
|
||||||
"@testing-library/jest-dom": "^6.9.1",
|
"@testing-library/jest-dom": "^6.9.1",
|
||||||
"@testing-library/react": "^16.3.2",
|
"@testing-library/react": "^16.3.2",
|
||||||
|
"@types/node": "^20.17.16",
|
||||||
"@types/react": "^19.2.10",
|
"@types/react": "^19.2.10",
|
||||||
"@types/react-dom": "^19.2.3",
|
"@types/react-dom": "^19.2.3",
|
||||||
"@vitejs/plugin-react": "^5.1.2",
|
"@vitejs/plugin-react": "^5.1.2",
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint/eslintrc": "^3.0.0",
|
"@eslint/eslintrc": "^3.0.0",
|
||||||
"@eslint/js": "^9.39.2",
|
"@eslint/js": "^9.39.2",
|
||||||
|
"@next/eslint-plugin-next": "15.1.6",
|
||||||
"eslint-config-next": "15.1.6",
|
"eslint-config-next": "15.1.6",
|
||||||
"typescript-eslint": "^8.54.0"
|
"typescript-eslint": "^8.54.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,9 +79,11 @@ export default async function LoginPage({ searchParams }: LoginPageProps) {
|
|||||||
timestamp: Date.now(),
|
timestamp: Date.now(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const isDev = process.env.NODE_ENV === "development";
|
||||||
|
|
||||||
cookieStore.set(authCookieName, sessionValue, {
|
cookieStore.set(authCookieName, sessionValue, {
|
||||||
httpOnly: true,
|
httpOnly: true,
|
||||||
secure: true,
|
secure: !isDev,
|
||||||
path: "/",
|
path: "/",
|
||||||
maxAge: 30 * 24 * 60 * 60, // 30 days
|
maxAge: 30 * 24 * 60 * 60, // 30 days
|
||||||
sameSite: "lax",
|
sameSite: "lax",
|
||||||
|
|||||||
8
pnpm-lock.yaml
generated
8
pnpm-lock.yaml
generated
@@ -29,6 +29,9 @@ importers:
|
|||||||
'@testing-library/react':
|
'@testing-library/react':
|
||||||
specifier: ^16.3.2
|
specifier: ^16.3.2
|
||||||
version: 16.3.2(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.10))(@types/react@19.2.10)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
version: 16.3.2(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.10))(@types/react@19.2.10)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
||||||
|
'@types/node':
|
||||||
|
specifier: ^20.17.16
|
||||||
|
version: 20.19.30
|
||||||
'@types/react':
|
'@types/react':
|
||||||
specifier: ^19.2.10
|
specifier: ^19.2.10
|
||||||
version: 19.2.10
|
version: 19.2.10
|
||||||
@@ -166,6 +169,9 @@ importers:
|
|||||||
'@eslint/js':
|
'@eslint/js':
|
||||||
specifier: ^9.39.2
|
specifier: ^9.39.2
|
||||||
version: 9.39.2
|
version: 9.39.2
|
||||||
|
'@next/eslint-plugin-next':
|
||||||
|
specifier: 15.1.6
|
||||||
|
version: 15.1.6
|
||||||
eslint-config-next:
|
eslint-config-next:
|
||||||
specifier: 15.1.6
|
specifier: 15.1.6
|
||||||
version: 15.1.6(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3)
|
version: 15.1.6(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3)
|
||||||
@@ -8566,7 +8572,7 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
array-union: 2.1.0
|
array-union: 2.1.0
|
||||||
dir-glob: 3.0.1
|
dir-glob: 3.0.1
|
||||||
fast-glob: 3.3.1
|
fast-glob: 3.3.3
|
||||||
ignore: 5.3.2
|
ignore: 5.3.2
|
||||||
merge2: 1.4.1
|
merge2: 1.4.1
|
||||||
slash: 3.0.0
|
slash: 3.0.0
|
||||||
|
|||||||
Reference in New Issue
Block a user