import { Body, Controller, HttpCode, HttpStatus, Post, SerializeOptions, } from '@nestjs/common'; import { ApiTags } from '@nestjs/swagger'; import { AuthService } from '../auth/auth.service'; import { AuthAppleService } from './auth-apple.service'; import { AuthAppleLoginDto } from './dto/auth-apple-login.dto'; import { LoginResponseType } from '../auth/types/login-response.type'; @ApiTags('Auth') @Controller({ path: 'auth/apple', version: '1', }) export class AuthAppleController { constructor( private readonly authService: AuthService, private readonly authAppleService: AuthAppleService, ) {} @SerializeOptions({ groups: ['me'], }) @Post('login') @HttpCode(HttpStatus.OK) async login(@Body() loginDto: AuthAppleLoginDto): Promise { const socialData = await this.authAppleService.getProfileByToken(loginDto); return this.authService.validateSocialLogin('apple', socialData); } }