Skip to content

Commit

Permalink
feat: signup back
Browse files Browse the repository at this point in the history
  • Loading branch information
kyeahxx19 committed Nov 14, 2023
1 parent 9d7b355 commit 5018056
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,34 @@ export class AuthController {
}
}

@Get('/signup/back')
@UseGuards(SignupGuard)
@ApiBadRequestResponse({
description: 'invalid signup token',
})
@ApiCreatedResponse({
description: 'new signup token',
type: SignupTokenResponseDto,
})
@ApiOperation({
summary: '회원가입 뒤로가기',
description: '이전 signup token 발행',
})
async signupBack(@Req() req: Request, @Res() res: Response) {
try {
const { id, infoId, page } = req.user as SignupPayload;
const signupToken = await this.authService.getSignupToken({
id: id,
infoId: infoId,
page: page - 2,
});

return res.json({ signupToken: signupToken });
} catch (err) {
res.status(err.status).json(err);
}
}

@Post('/login')
@ApiOperation({ deprecated: true })
async login(@Body() loginDto: LoginDto, @Res() res: Response) {
Expand Down

0 comments on commit 5018056

Please sign in to comment.