+export type SignupMode = 'direct-registration' | 'request-registration'
+
+async function isSignupAllowed (options: {
+ signupMode: SignupMode
+
+ ip: string // For plugins
+ body?: any
+}): Promise<{ allowed: boolean, errorMessage?: string }> {
+ const { signupMode } = options
+