Skip to content

Commit

Permalink
resolved #22 free 3 days of premium package during account creation
Browse files Browse the repository at this point in the history
  • Loading branch information
rokartur committed May 26, 2024
1 parent 7d468ba commit bd8224e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
Binary file modified backend/bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 10 additions & 0 deletions backend/src/routes/oauth/callback/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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 })

Expand Down

0 comments on commit bd8224e

Please sign in to comment.