✨ Add usage-based new pricing plans
This commit is contained in:
committed by
Baptiste Arnaud
parent
6a1eaea700
commit
898367a33b
@ -12,6 +12,7 @@ import { withSentry } from '@sentry/nextjs'
|
||||
import { CustomAdapter } from './adapter'
|
||||
import { User } from 'db'
|
||||
import { env, isNotEmpty } from 'utils'
|
||||
import { mockedUser } from 'services/api/utils'
|
||||
|
||||
const providers: Provider[] = []
|
||||
|
||||
@ -98,6 +99,14 @@ if (
|
||||
}
|
||||
|
||||
const handler = (req: NextApiRequest, res: NextApiResponse) => {
|
||||
if (
|
||||
req.method === 'GET' &&
|
||||
req.url === '/api/auth/session' &&
|
||||
env('E2E_TEST') === 'true'
|
||||
) {
|
||||
res.send({ user: mockedUser })
|
||||
return
|
||||
}
|
||||
if (req.method === 'HEAD') {
|
||||
res.status(200)
|
||||
return
|
||||
|
@ -52,10 +52,11 @@ export function CustomAdapter(p: PrismaClient): Adapter {
|
||||
name: data.name
|
||||
? `${data.name}'s workspace`
|
||||
: `My workspace`,
|
||||
plan:
|
||||
process.env.ADMIN_EMAIL === data.email
|
||||
? Plan.TEAM
|
||||
: Plan.FREE,
|
||||
...(process.env.ADMIN_EMAIL === data.email
|
||||
? { plan: Plan.LIFETIME }
|
||||
: {
|
||||
plan: Plan.FREE,
|
||||
}),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user