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)',
)
.eq('invite_token', token)
.rangeLt('expires_at', new Date().toISOString())
.gte('expires_at', new Date().toISOString())
.single();
console.log(invitation, error);

View File

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

View File

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