presenter refactoring

This commit is contained in:
2025-12-20 17:06:11 +01:00
parent 92be9d2e1b
commit e9d6f90bb2
109 changed files with 4159 additions and 1283 deletions

View File

@@ -8,22 +8,26 @@ export class AuthController {
@Post('signup')
async signup(@Body() params: SignupParams): Promise<AuthSessionDTO> {
return this.authService.signupWithEmail(params);
const presenter = await this.authService.signupWithEmail(params);
return presenter.viewModel;
}
@Post('login')
async login(@Body() params: LoginParams): Promise<AuthSessionDTO> {
return this.authService.loginWithEmail(params);
const presenter = await this.authService.loginWithEmail(params);
return presenter.viewModel;
}
@Get('session')
async getSession(): Promise<AuthSessionDTO | null> {
return this.authService.getCurrentSession();
const presenter = await this.authService.getCurrentSession();
return presenter ? presenter.viewModel : null;
}
@Post('logout')
async logout(): Promise<void> {
return this.authService.logout();
async logout(): Promise<{ success: boolean }> {
const presenter = await this.authService.logout();
return presenter.viewModel;
}
}