feat: add basic auth

This commit is contained in:
2026-10-21 10:31:23 +03:00
parent ef2bc6f8b6
commit 0563ebfb10
28 changed files with 633 additions and 176 deletions
+7 -3
View File
@@ -6,8 +6,8 @@ import {
Post,
UseGuards,
} from '@nestjs/common';
import { AuthGuard } from '../common/auth/auth.guard';
import { CurrentUser } from '../common/auth/current-user.decorator';
import { AuthGuard } from '../auth/auth.guard';
import { CurrentUser } from '../auth/current-user.decorator';
import { User } from '../common/domain';
import { CreateUserDto } from './dto/create-user.dto';
import { toUserResponse, UserResponse } from './dto/user.response';
@@ -20,7 +20,11 @@ export class UsersController {
@Post()
@HttpCode(201)
async create(@Body() dto: CreateUserDto): Promise<UserResponse> {
const user = await this.users.register(dto.username, dto.display_name);
const user = await this.users.register(
dto.username,
dto.display_name,
dto.password,
);
return toUserResponse(user);
}