feat: prepare six-lesson trial backend with reliable rewards and operations
Backend CI / type-check, build, tests (push) Successful in 1m0s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-12 14:35:42 +03:30
co-authored by Cursor
parent 5e5a14030a
commit dfb20ca92c
46 changed files with 2589 additions and 123 deletions
+8 -3
View File
@@ -1,5 +1,8 @@
import { Body, Controller, HttpCode, Inject, Post, forwardRef } from '@nestjs/common'
import { Body, Controller, HttpCode, Inject, Post, Req, forwardRef } from '@nestjs/common'
import type { FastifyRequest } from 'fastify'
import { Public } from '../common/decorators/public.decorator'
import { getClientIp } from '../common/http/client-ip'
import { assertAuthRateLimit } from '../common/rate-limit/auth-rate-limit'
import { strictBodyPipe } from '../common/pipes/strict-body.pipe'
import { AuthService } from './auth.service'
import { LoginDto } from './dto/login.dto'
@@ -12,14 +15,16 @@ export class AuthController {
@Public()
@HttpCode(200)
@Post('register')
register(@Body(strictBodyPipe(RegisterDto)) dto: RegisterDto) {
register(@Req() req: FastifyRequest, @Body(strictBodyPipe(RegisterDto)) dto: RegisterDto) {
assertAuthRateLimit(getClientIp(req))
return this.auth.register(dto.username, dto.password, dto.name)
}
@Public()
@HttpCode(200)
@Post('login')
login(@Body(strictBodyPipe(LoginDto)) dto: LoginDto) {
login(@Req() req: FastifyRequest, @Body(strictBodyPipe(LoginDto)) dto: LoginDto) {
assertAuthRateLimit(getClientIp(req))
return this.auth.login(dto.username, dto.password)
}
}