2
0

build: 🏗️ Add docker image and deployment features

This commit is contained in:
Baptiste Arnaud
2022-03-12 07:53:37 +01:00
parent 1dbbc9a251
commit e886d1b079
30 changed files with 2020 additions and 2136 deletions

View File

@@ -1,5 +1,5 @@
// Forked from https://github.com/nextauthjs/adapters/blob/main/packages/prisma/src/index.ts
import type { PrismaClient, Prisma, Invitation } from 'db'
import { PrismaClient, Prisma, Invitation, Plan } from 'db'
import { randomUUID } from 'crypto'
import type { Adapter, AdapterUser } from 'next-auth/adapters'
import cuid from 'cuid'
@@ -12,7 +12,12 @@ export function CustomAdapter(p: PrismaClient): Adapter {
where: { email: user.email },
})
const createdUser = await p.user.create({
data: { ...data, id: user.id, apiToken: randomUUID() },
data: {
...data,
id: user.id,
apiToken: randomUUID(),
plan: process.env.ADMIN_EMAIL === data.email ? Plan.PRO : Plan.FREE,
},
})
if (invitations.length > 0)
await convertInvitationsToCollaborations(p, user, invitations)