11import { Body , Controller , Post , HttpCode , HttpStatus , BadRequestException } from '@nestjs/common' ;
22import { AuthService } from './auth.service' ;
33import { GoogleAuthInput } from './dto/google-auth.input' ;
4- import { ApiTags , ApiOperation , ApiResponse , ApiParam } from '@nestjs/swagger' ;
5- import { ApiPaginationQuery } from '../common/decorators/api-nested-query .decorator' ;
4+ import { ApiTags } from '@nestjs/swagger' ;
5+ import { Api } from '../common/decorators/api.decorator' ;
66
77@ApiTags ( 'Auth' )
88@Controller ( 'auth' )
@@ -13,12 +13,16 @@ export class AuthController {
1313 * Fetch new jobs from Reddit and Web3Career, store them, and send notifications
1414 */
1515 @Post ( 'google' )
16- @ApiOperation ( {
17- summary : 'Fetch new jobs from Reddit and Web3Career' ,
18- description : 'Fetches new jobs from both sources, stores them, and sends notifications.' ,
16+ @Api ( {
17+ summary : 'Google authentication' ,
18+ description : 'Authenticate a user using a Google ID token and optional buildType.' ,
19+ bodyType : GoogleAuthInput ,
20+ envelope : true ,
21+ responses : [
22+ { status : 200 , description : 'Authenticated successfully.' } ,
23+ { status : 400 , description : 'ID token missing or invalid.' } ,
24+ ] ,
1925 } )
20- @ApiParam ( { name : 'idToken' , description : 'Google ID Token' , type : String } )
21- @ApiResponse ( { status : 200 , description : 'Jobs fetched and notifications sent.' } )
2226 @HttpCode ( HttpStatus . OK )
2327 async googleAuth ( @Body ( ) googleAuthInput : GoogleAuthInput ) {
2428 const { idToken, buildType } = googleAuthInput ;
0 commit comments