diff --git a/backend/bun.lockb b/backend/bun.lockb index 6bcabc8..b3bc03a 100755 Binary files a/backend/bun.lockb and b/backend/bun.lockb differ diff --git a/backend/package.json b/backend/package.json index 6ef2798..f0dd4bc 100644 --- a/backend/package.json +++ b/backend/package.json @@ -25,6 +25,7 @@ "elysia-rate-limit": "^3.2.2", "logestic": "^1.1.1", "lucia": "^3.2.0", + "moment": "^2.30.1", "pg": "^8.11.5", "postgres": "^3.4.4", "react": "^18.3.1", diff --git a/backend/src/routes/oauth/callback/index.ts b/backend/src/routes/oauth/callback/index.ts index 8ae102b..0d0e9e5 100644 --- a/backend/src/routes/oauth/callback/index.ts +++ b/backend/src/routes/oauth/callback/index.ts @@ -6,6 +6,7 @@ import { eq } from 'drizzle-orm' import { users } from '@/db/schema' import { lucia } from '@/utils/lucia' import { t } from 'elysia' +import moment from 'moment' export default (app: ElysiaApp) => app.get( @@ -52,6 +53,15 @@ export default (app: ElysiaApp) => username: githubData.login, email: githubData.email || '', profilePictureUrl: githubData.avatar_url, + subscriptionExpirationDate: moment + .utc() + .add(3, 'd') + .set('hour', 0) + .set('minute', 0) + .set('second', 0) + .set('millisecond', 0) + .toDate() + .toISOString(), }) .returning({ id: users.id })