⚡ Make the default workspace plan configurable
Set it with a `DEFAULT_WORKSPACE_PLAN` env variable Closes #152
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
export * from './parseNewName'
|
||||
export * from './parseWorkspaceDefaultPlan'
|
||||
export * from './setWorkspaceIdInLocalStorage'
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import { Plan } from 'db'
|
||||
|
||||
export const parseWorkspaceDefaultPlan = (userEmail: string) => {
|
||||
if (process.env.ADMIN_EMAIL === userEmail) return Plan.LIFETIME
|
||||
const defaultPlan = process.env.DEFAULT_WORKSPACE_PLAN as Plan | undefined
|
||||
if (defaultPlan && Object.values(Plan).includes(defaultPlan))
|
||||
return defaultPlan
|
||||
return Plan.FREE
|
||||
}
|
||||
Reference in New Issue
Block a user