Skip to content

Commit 5d377d0

Browse files
committed
Check is user enabled on post comment
1 parent af45c33 commit 5d377d0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/app.controller.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ export class AppController {
9494
if(!req.user) {
9595
throw new BadRequestException('InvalidJWT')
9696
}
97-
const { address } = plainToInstance(JwtUserAccount, req.user)
97+
const { address, isEnabled } = plainToInstance(JwtUserAccount, req.user)
98+
99+
if(!isEnabled) {
100+
throw new ForbiddenException('User is disabled')
101+
}
102+
98103
const token = await this.appService.getTokenByAddress(dto.tokenAddress)
99104
if(!token) {
100105
throw new NotFoundException('Token not found')

0 commit comments

Comments
 (0)