/
dluchko
/
verta
Обзор
Документация
Войти
/
dluchko
/
verta
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
backend/src/modules/auth/auth.controller.ts
38 строк
1 KB
dluchko
Initial commit: Verta Cloud Computer Platform MVP
06 июл 2026, 09:40
06 июл 2026, 09:40
89697a4
Код
Авторство
О чём код?
import { Controller, Post, Body, UseGuards, Get, Patch, Delete, HttpCode, HttpStatus } from '@nestjs/common'; import { AuthService } from './auth.service'; import { RegisterDto } from './dto/register.dto'; import { LoginDto } from './dto/login.dto'; import { GetCurrentUserId } from '../../common/decorators/current-user.decorator'; @Controller('auth') export class AuthController { constructor(private readonly authService: AuthService) {} @Post('register') async register(@Body() dto: RegisterDto) { return this.authService.register(dto.email, dto.password); } @Post('login') @HttpCode(HttpStatus.OK) async login(@Body() dto: LoginDto) { return this.authService.login(dto.email, dto.password); } @Post('refresh') async refreshTokens(@Body('refreshToken') refreshToken: string) { return this.authService.refreshTokens(refreshToken); } @Post('logout') @HttpCode(HttpStatus.OK) async logout(@Body('refreshToken') refreshToken: string) { return this.authService.logout(refreshToken); } @Get('me') async getProfile(@GetCurrentUserId() userId: string) { // Will be implemented in Users module return { userId, message: 'Profile endpoint - to be implemented' }; } }