import { Controller, Post, Body } from '@nestjs/common';
import { TokenService } from '../services/token.service';

@Controller('auth')
export class AuthController {
  constructor(private readonly tokenService: TokenService) {}

  @Post('token')
  createToken(@Body() body: { name?: string; expiresInHours?: number }) {
    return this.tokenService.createToken(body.name, body.expiresInHours);
  }
}
