Update Next.js version and fix invite expiration check

This commit increments the Next.js version to 14.2.0-canary.48 and updates the related dependencies' versions in the lock file as well. Additionally, it corrects the invitation expiration check on the join page. Previously, it was checking for a date less than the current time which caused it to invalidate valid tokens; now, it correctly checks for dates greater than or equal to the current time.
This commit is contained in:
giancarlo
2024-03-29 12:26:37 +08:00
parent d8ead74a1b
commit f1967a686c
4 changed files with 48 additions and 49 deletions

View File

@@ -134,7 +134,7 @@ async function getInviteDataFromInviteToken(token: string) {
'id, expires_at, account: account_id !inner (id, name, slug, picture_url)', 'id, expires_at, account: account_id !inner (id, name, slug, picture_url)',
) )
.eq('invite_token', token) .eq('invite_token', token)
.rangeLt('expires_at', new Date().toISOString()) .gte('expires_at', new Date().toISOString())
.single(); .single();
console.log(invitation, error); console.log(invitation, error);

View File

@@ -21,7 +21,6 @@ const INTERNAL_PACKAGES = [
/** @type {import('next').NextConfig} */ /** @type {import('next').NextConfig} */
const config = { const config = {
reactStrictMode: true, reactStrictMode: true,
swcMinify: true,
/** Enables hot reloading for local packages without a build step */ /** Enables hot reloading for local packages without a build step */
transpilePackages: INTERNAL_PACKAGES, transpilePackages: INTERNAL_PACKAGES,
pageExtensions: ['ts', 'tsx'], pageExtensions: ['ts', 'tsx'],

View File

@@ -41,7 +41,7 @@
"edge-csrf": "^1.0.9", "edge-csrf": "^1.0.9",
"i18next": "^23.10.1", "i18next": "^23.10.1",
"i18next-resources-to-backend": "^1.2.0", "i18next-resources-to-backend": "^1.2.0",
"next": "canary", "next": "14.2.0-canary.48",
"next-contentlayer": "0.3.4", "next-contentlayer": "0.3.4",
"next-sitemap": "^4.2.3", "next-sitemap": "^4.2.3",
"next-themes": "0.3.0", "next-themes": "0.3.0",

92
pnpm-lock.yaml generated
View File

@@ -91,7 +91,7 @@ importers:
version: 5.28.6(react@18.2.0) version: 5.28.6(react@18.2.0)
'@tanstack/react-query-next-experimental': '@tanstack/react-query-next-experimental':
specifier: ^5.28.9 specifier: ^5.28.9
version: 5.28.9(@tanstack/react-query@5.28.6)(next@14.2.0-canary.47)(react@18.2.0) version: 5.28.9(@tanstack/react-query@5.28.6)(next@14.2.0-canary.48)(react@18.2.0)
'@tanstack/react-table': '@tanstack/react-table':
specifier: ^8.15.0 specifier: ^8.15.0
version: 8.15.0(react-dom@18.2.0)(react@18.2.0) version: 8.15.0(react-dom@18.2.0)(react@18.2.0)
@@ -103,7 +103,7 @@ importers:
version: 3.6.0 version: 3.6.0
edge-csrf: edge-csrf:
specifier: ^1.0.9 specifier: ^1.0.9
version: 1.0.9(next@14.2.0-canary.47) version: 1.0.9(next@14.2.0-canary.48)
i18next: i18next:
specifier: ^23.10.1 specifier: ^23.10.1
version: 23.10.1 version: 23.10.1
@@ -111,14 +111,14 @@ importers:
specifier: ^1.2.0 specifier: ^1.2.0
version: 1.2.0 version: 1.2.0
next: next:
specifier: canary specifier: 14.2.0-canary.48
version: 14.2.0-canary.47(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0) version: 14.2.0-canary.48(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0)
next-contentlayer: next-contentlayer:
specifier: 0.3.4 specifier: 0.3.4
version: 0.3.4(contentlayer@0.3.4)(esbuild@0.20.2)(next@14.2.0-canary.47)(react-dom@18.2.0)(react@18.2.0) version: 0.3.4(contentlayer@0.3.4)(esbuild@0.20.2)(next@14.2.0-canary.48)(react-dom@18.2.0)(react@18.2.0)
next-sitemap: next-sitemap:
specifier: ^4.2.3 specifier: ^4.2.3
version: 4.2.3(next@14.2.0-canary.47) version: 4.2.3(next@14.2.0-canary.48)
next-themes: next-themes:
specifier: 0.3.0 specifier: 0.3.0
version: 0.3.0(react-dom@18.2.0)(react@18.2.0) version: 0.3.0(react-dom@18.2.0)(react@18.2.0)
@@ -2025,8 +2025,8 @@ packages:
resolution: {integrity: sha512-Py8zIo+02ht82brwwhTg36iogzFqGLPXlRGKQw5s+qP/kMNc4MAyDeEwBKDijk6zTIbegEgu8Qy7C1LboslQAw==} resolution: {integrity: sha512-Py8zIo+02ht82brwwhTg36iogzFqGLPXlRGKQw5s+qP/kMNc4MAyDeEwBKDijk6zTIbegEgu8Qy7C1LboslQAw==}
dev: false dev: false
/@next/env@14.2.0-canary.47: /@next/env@14.2.0-canary.48:
resolution: {integrity: sha512-AURjF/V33qm2JSik8jS6wz4R0kl4uhi1m8k1z4x8wxYi0KbO5YgFvqWRFr7hKy1wr9pJW39kwFgci2XftxDFww==} resolution: {integrity: sha512-NhLe3TJ3/A0FyV/mezwpmFudLX6yzcq619bAeaL/KOQA8OkDb/zwFfbrqdibwIgRmID8pGirtzsfN6iwJzwQKA==}
dev: false dev: false
/@next/eslint-plugin-next@14.1.4: /@next/eslint-plugin-next@14.1.4:
@@ -2058,8 +2058,8 @@ packages:
dev: false dev: false
optional: true optional: true
/@next/swc-darwin-arm64@14.2.0-canary.47: /@next/swc-darwin-arm64@14.2.0-canary.48:
resolution: {integrity: sha512-9nemlI7DMtq1OB3r4pxuVz1nU8rMEk/e7QBO1Hc+Ss+Z98HhvlqzFIShmS6LwQKa0q6KEKOdufFwtU9WG5FXTw==} resolution: {integrity: sha512-pJX5jVTFPSymGvLk7WxKKf/TTL3/SwaeerIIr42xYK8w9hq7hTQo71ML+4l5rba4AvJ9dwlZUP5Ie/AjVXpq7w==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm64] cpu: [arm64]
os: [darwin] os: [darwin]
@@ -2076,8 +2076,8 @@ packages:
dev: false dev: false
optional: true optional: true
/@next/swc-darwin-x64@14.2.0-canary.47: /@next/swc-darwin-x64@14.2.0-canary.48:
resolution: {integrity: sha512-eq3ZnKg/h9Nmy7ocTOp+3v8F9id2Ar10TCBMz/JZmreeKNpNfUznIMsdNVMgqXbXoFCpLDbIMLf4qmVF3+OlQg==} resolution: {integrity: sha512-o38yJhgZEZIPKMYDQevKBEtCEh6iEplJqY5MxiZ+qbjTdDVStdKZBY2O5fucVDVcP4Lb2r9lvfYIjY5G54adsQ==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [x64] cpu: [x64]
os: [darwin] os: [darwin]
@@ -2094,8 +2094,8 @@ packages:
dev: false dev: false
optional: true optional: true
/@next/swc-linux-arm64-gnu@14.2.0-canary.47: /@next/swc-linux-arm64-gnu@14.2.0-canary.48:
resolution: {integrity: sha512-CopkMncPw34uIh11KK9XtKjSjCS/R40TDRjXI+nq33y0WPfamQMKY5HgjL27qi6Yt5XbJwZhBVZx13vSC5u1Aw==} resolution: {integrity: sha512-N7agPv2AFHZ2TG+bjhXtjTpLWk26wv9C1Fmj8RmYPyAmZE3SeEbgAW3Pr/+zSk8oF0EMq9rzJpYBPa1itRM0Qw==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
@@ -2112,8 +2112,8 @@ packages:
dev: false dev: false
optional: true optional: true
/@next/swc-linux-arm64-musl@14.2.0-canary.47: /@next/swc-linux-arm64-musl@14.2.0-canary.48:
resolution: {integrity: sha512-T0Z8ECr3QerlsDAYjreyg3A6gof12dCC7sdCeTBMhLZw4JjhITfg1jrUUVWFJrASBQaYwEip001jJpyIt7NPmg==} resolution: {integrity: sha512-Ka4XjbGkX84Wh5jgNXxTkNv+fls2YBbIFTRq9jGGGOLFRiem6U1k4uf3L8WxbyDUmF/cXebQsCn73AHbe8gXsw==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
@@ -2130,8 +2130,8 @@ packages:
dev: false dev: false
optional: true optional: true
/@next/swc-linux-x64-gnu@14.2.0-canary.47: /@next/swc-linux-x64-gnu@14.2.0-canary.48:
resolution: {integrity: sha512-IqaXu8km8fH3/tzluq5Arc6Yt2GaZuFF/P+uCY82MunLN+TN5FGdLpRRUbCnzlGuxTomhY4z9mRNL+3xSJP/Jg==} resolution: {integrity: sha512-VhYSQ2RkWFyvzn0F3qsqVrC8JsCZuzry7QlizuRrSZImOMgPKcozhRUPagtUmjC57wki4je2UtuXgt88Ac4eZg==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
@@ -2148,8 +2148,8 @@ packages:
dev: false dev: false
optional: true optional: true
/@next/swc-linux-x64-musl@14.2.0-canary.47: /@next/swc-linux-x64-musl@14.2.0-canary.48:
resolution: {integrity: sha512-0UluZrjveAaTmW9sNZcbhgL8Hyi1hiQzS4njau7T480M6L+dPSWx3c4W029dSBJrBVquB5mwUzjtcIQoFZPCWw==} resolution: {integrity: sha512-+Gcza5SdYJ2nWhH6LQB/uuDhRHnDuQgzgdZ93LLV4VdrPERntl+Qkq2ZKBrL2y6jBCP7fQ9ClZkddQZw57pgeQ==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
@@ -2166,8 +2166,8 @@ packages:
dev: false dev: false
optional: true optional: true
/@next/swc-win32-arm64-msvc@14.2.0-canary.47: /@next/swc-win32-arm64-msvc@14.2.0-canary.48:
resolution: {integrity: sha512-dEHvVCNlKUOMD2w8jXMIQy+/0OQHU5EHycamS5zL9cleHX2JJEyy0V0amJYJsc+26NRRSCUDC26xjCQNL27x6g==} resolution: {integrity: sha512-zLbhMvmizwFmbnlYzvXDq+DwKZ8kB4uxJ12nq5+CjodIPlkCzdrHBjqq0I1D66ohd/8C53XqXdS82teeNcW7qA==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm64] cpu: [arm64]
os: [win32] os: [win32]
@@ -2184,8 +2184,8 @@ packages:
dev: false dev: false
optional: true optional: true
/@next/swc-win32-ia32-msvc@14.2.0-canary.47: /@next/swc-win32-ia32-msvc@14.2.0-canary.48:
resolution: {integrity: sha512-BJP9qLYP4n9XXOzj/mTpPRS3F4/+fduDrr5HfGp++lo898MX3wG9Mq4mrkr7WWzzlU3nuehHE9DLEwyFHtyi9w==} resolution: {integrity: sha512-lFEUP1tZ9jgAucWqZd3vCexfcmuTRXUh5qWHm4MymgchTX/FO2z3drum7Bv5fc1NdLiLy5H/ENxhhVezWbfAZg==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [ia32] cpu: [ia32]
os: [win32] os: [win32]
@@ -2202,8 +2202,8 @@ packages:
dev: false dev: false
optional: true optional: true
/@next/swc-win32-x64-msvc@14.2.0-canary.47: /@next/swc-win32-x64-msvc@14.2.0-canary.48:
resolution: {integrity: sha512-Ee/xNaiP2S0y9emmumoqa9poi6e7oWxYZajJpbXcRIT8hURzRYgAN0+YaX86Y33M2XJ9UIX0KcUSXjCQ9zPQuA==} resolution: {integrity: sha512-ZfMKA0x+mnmfL0QnEtNWqE3jSZQhOqlMRc/tYWJBCTOqPxJxVW0j24enlFBzvrYwBbIi5OBdonvaXIOZaJl1yA==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [x64] cpu: [x64]
os: [win32] os: [win32]
@@ -4175,7 +4175,7 @@ packages:
/@tanstack/query-core@5.28.6: /@tanstack/query-core@5.28.6:
resolution: {integrity: sha512-hnhotV+DnQtvtR3jPvbQMPNMW4KEK0J4k7c609zJ8muiNknm+yoDyMHmxTWM5ZnlZpsz0zOxYFr+mzRJNHWJsA==} resolution: {integrity: sha512-hnhotV+DnQtvtR3jPvbQMPNMW4KEK0J4k7c609zJ8muiNknm+yoDyMHmxTWM5ZnlZpsz0zOxYFr+mzRJNHWJsA==}
/@tanstack/react-query-next-experimental@5.28.9(@tanstack/react-query@5.28.6)(next@14.2.0-canary.47)(react@18.2.0): /@tanstack/react-query-next-experimental@5.28.9(@tanstack/react-query@5.28.6)(next@14.2.0-canary.48)(react@18.2.0):
resolution: {integrity: sha512-cihvqAme8nX6O5jeWtk19fnMsgXTX5puHwj6ya2Gf6FZIKhcFTrXQ9npH3ACcbinmVYPcQrShk/D3XAGKR/AUg==} resolution: {integrity: sha512-cihvqAme8nX6O5jeWtk19fnMsgXTX5puHwj6ya2Gf6FZIKhcFTrXQ9npH3ACcbinmVYPcQrShk/D3XAGKR/AUg==}
peerDependencies: peerDependencies:
'@tanstack/react-query': ^5.28.9 '@tanstack/react-query': ^5.28.9
@@ -4183,7 +4183,7 @@ packages:
react: ^18.0.0 react: ^18.0.0
dependencies: dependencies:
'@tanstack/react-query': 5.28.6(react@18.2.0) '@tanstack/react-query': 5.28.6(react@18.2.0)
next: 14.2.0-canary.47(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0) next: 14.2.0-canary.48(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0 react: 18.2.0
dev: false dev: false
@@ -5971,12 +5971,12 @@ packages:
/eastasianwidth@0.2.0: /eastasianwidth@0.2.0:
resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==}
/edge-csrf@1.0.9(next@14.2.0-canary.47): /edge-csrf@1.0.9(next@14.2.0-canary.48):
resolution: {integrity: sha512-3F89YTh42UDdISr3s9AEcgJDLi4ysgjGfnybzF0LuZGaG2W31h1ZwgWwEQBLMj04lAklcP4XHZYi7vk9o8zcbg==} resolution: {integrity: sha512-3F89YTh42UDdISr3s9AEcgJDLi4ysgjGfnybzF0LuZGaG2W31h1ZwgWwEQBLMj04lAklcP4XHZYi7vk9o8zcbg==}
peerDependencies: peerDependencies:
next: ^13.0.0 || ^14.0.0 next: ^13.0.0 || ^14.0.0
dependencies: dependencies:
next: 14.2.0-canary.47(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0) next: 14.2.0-canary.48(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0)
dev: false dev: false
/editorconfig@1.0.4: /editorconfig@1.0.4:
@@ -8661,7 +8661,7 @@ packages:
engines: {node: '>= 0.4.0'} engines: {node: '>= 0.4.0'}
dev: false dev: false
/next-contentlayer@0.3.4(contentlayer@0.3.4)(esbuild@0.20.2)(next@14.2.0-canary.47)(react-dom@18.2.0)(react@18.2.0): /next-contentlayer@0.3.4(contentlayer@0.3.4)(esbuild@0.20.2)(next@14.2.0-canary.48)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-UtUCwgAl159KwfhNaOwyiI7Lg6sdioyKMeh+E7jxx0CJ29JuXGxBEYmCI6+72NxFGIFZKx8lvttbbQhbnYWYSw==} resolution: {integrity: sha512-UtUCwgAl159KwfhNaOwyiI7Lg6sdioyKMeh+E7jxx0CJ29JuXGxBEYmCI6+72NxFGIFZKx8lvttbbQhbnYWYSw==}
peerDependencies: peerDependencies:
contentlayer: 0.3.4 contentlayer: 0.3.4
@@ -8672,7 +8672,7 @@ packages:
'@contentlayer/core': 0.3.4(esbuild@0.20.2) '@contentlayer/core': 0.3.4(esbuild@0.20.2)
'@contentlayer/utils': 0.3.4 '@contentlayer/utils': 0.3.4
contentlayer: 0.3.4(esbuild@0.20.2) contentlayer: 0.3.4(esbuild@0.20.2)
next: 14.2.0-canary.47(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0) next: 14.2.0-canary.48(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0 react: 18.2.0
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
transitivePeerDependencies: transitivePeerDependencies:
@@ -8682,7 +8682,7 @@ packages:
- supports-color - supports-color
dev: false dev: false
/next-sitemap@4.2.3(next@14.2.0-canary.47): /next-sitemap@4.2.3(next@14.2.0-canary.48):
resolution: {integrity: sha512-vjdCxeDuWDzldhCnyFCQipw5bfpl4HmZA7uoo3GAaYGjGgfL4Cxb1CiztPuWGmS+auYs7/8OekRS8C2cjdAsjQ==} resolution: {integrity: sha512-vjdCxeDuWDzldhCnyFCQipw5bfpl4HmZA7uoo3GAaYGjGgfL4Cxb1CiztPuWGmS+auYs7/8OekRS8C2cjdAsjQ==}
engines: {node: '>=14.18'} engines: {node: '>=14.18'}
hasBin: true hasBin: true
@@ -8693,7 +8693,7 @@ packages:
'@next/env': 13.5.6 '@next/env': 13.5.6
fast-glob: 3.3.2 fast-glob: 3.3.2
minimist: 1.2.8 minimist: 1.2.8
next: 14.2.0-canary.47(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0) next: 14.2.0-canary.48(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0)
dev: false dev: false
/next-themes@0.3.0(react-dom@18.2.0)(react@18.2.0): /next-themes@0.3.0(react-dom@18.2.0)(react@18.2.0):
@@ -8744,8 +8744,8 @@ packages:
- babel-plugin-macros - babel-plugin-macros
dev: false dev: false
/next@14.2.0-canary.47(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0): /next@14.2.0-canary.48(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-gtOUWhd+diNCTeRQAMFVRFx2Fo6WKCfFWZ+yg/2TgUnF1dc+tMFU0OYjXM1NRs4Yc6jdyqzeanH3oYYSokwg1w==} resolution: {integrity: sha512-pRuzodk1R1MZ54VELbZVyj30F2QS4CtnHPcSiMHh9GICAZ/ZLHeOyiTtcpijb8M3hRXs7Cui2xUDUR0k6zjT7Q==}
engines: {node: '>=18.17.0'} engines: {node: '>=18.17.0'}
hasBin: true hasBin: true
peerDependencies: peerDependencies:
@@ -8762,7 +8762,7 @@ packages:
sass: sass:
optional: true optional: true
dependencies: dependencies:
'@next/env': 14.2.0-canary.47 '@next/env': 14.2.0-canary.48
'@opentelemetry/api': 1.8.0 '@opentelemetry/api': 1.8.0
'@swc/helpers': 0.5.5 '@swc/helpers': 0.5.5
busboy: 1.6.0 busboy: 1.6.0
@@ -8773,15 +8773,15 @@ packages:
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
styled-jsx: 5.1.1(react@18.2.0) styled-jsx: 5.1.1(react@18.2.0)
optionalDependencies: optionalDependencies:
'@next/swc-darwin-arm64': 14.2.0-canary.47 '@next/swc-darwin-arm64': 14.2.0-canary.48
'@next/swc-darwin-x64': 14.2.0-canary.47 '@next/swc-darwin-x64': 14.2.0-canary.48
'@next/swc-linux-arm64-gnu': 14.2.0-canary.47 '@next/swc-linux-arm64-gnu': 14.2.0-canary.48
'@next/swc-linux-arm64-musl': 14.2.0-canary.47 '@next/swc-linux-arm64-musl': 14.2.0-canary.48
'@next/swc-linux-x64-gnu': 14.2.0-canary.47 '@next/swc-linux-x64-gnu': 14.2.0-canary.48
'@next/swc-linux-x64-musl': 14.2.0-canary.47 '@next/swc-linux-x64-musl': 14.2.0-canary.48
'@next/swc-win32-arm64-msvc': 14.2.0-canary.47 '@next/swc-win32-arm64-msvc': 14.2.0-canary.48
'@next/swc-win32-ia32-msvc': 14.2.0-canary.47 '@next/swc-win32-ia32-msvc': 14.2.0-canary.48
'@next/swc-win32-x64-msvc': 14.2.0-canary.47 '@next/swc-win32-x64-msvc': 14.2.0-canary.48
transitivePeerDependencies: transitivePeerDependencies:
- '@babel/core' - '@babel/core'
- babel-plugin-macros - babel-plugin-macros