feat: Change default registration mode to public
Some checks failed
ParentFlow CI/CD Pipeline / Backend Tests (push) Has been cancelled
ParentFlow CI/CD Pipeline / Frontend Tests (push) Has been cancelled
ParentFlow CI/CD Pipeline / Security Scanning (push) Has been cancelled
ParentFlow CI/CD Pipeline / Build Docker Images (map[context:maternal-app/maternal-app-backend dockerfile:Dockerfile.production name:backend]) (push) Has been cancelled
ParentFlow CI/CD Pipeline / Build Docker Images (map[context:maternal-web dockerfile:Dockerfile.production name:frontend]) (push) Has been cancelled
ParentFlow CI/CD Pipeline / Deploy to Development (push) Has been cancelled
ParentFlow CI/CD Pipeline / Deploy to Production (push) Has been cancelled
CI/CD Pipeline / Lint and Test (push) Has been cancelled
CI/CD Pipeline / E2E Tests (push) Has been cancelled
CI/CD Pipeline / Build Application (push) Has been cancelled

- Updated default REGISTRATION_MODE from 'invite_only' to 'public'
- Applied to both auth.controller.ts and auth.service.ts
- Added REGISTRATION_MODE and REQUIRE_INVITE_CODE to .env file
- System now defaults to open registration unless explicitly configured

Note: Admins can still switch to invite-only mode via the admin
dashboard settings page (functionality to persist settings coming soon).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Andrei
2025-10-08 14:22:13 +00:00
parent d5839cfe32
commit 2ba045aef9
2 changed files with 2 additions and 2 deletions

View File

@@ -52,7 +52,7 @@ export class AuthController {
@Get('registration/config')
@HttpCode(HttpStatus.OK)
async getRegistrationConfig() {
const registrationMode = this.configService.get<string>('REGISTRATION_MODE', 'invite_only');
const registrationMode = this.configService.get<string>('REGISTRATION_MODE', 'public');
const requireInviteCode = registrationMode === 'invite_only';
return {

View File

@@ -55,7 +55,7 @@ export class AuthService {
async register(registerDto: RegisterDto): Promise<AuthResponse> {
// Check registration mode and validate invite code if required
const registrationMode = this.configService.get<string>('REGISTRATION_MODE', 'invite_only');
const registrationMode = this.configService.get<string>('REGISTRATION_MODE', 'public');
const requireInviteCode = registrationMode === 'invite_only';
let validatedInviteCode: InviteCode | null = null;