-
Notifications
You must be signed in to change notification settings - Fork 1
[SELS-TASK-25] [BE]- Enable Authguards for the Lesson Quiz endpoint #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
5ace4dd to
72ab404
Compare
a002c38 to
6b7c269
Compare
| private choicesService: ChoicesService, | ||
| private jwtService: JwtService, | ||
| private userService: UserService | ||
| private readonly userService: UserService, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this set to readonly?
| async getChoices(@Param('wordId') wordId: number, @Req() request: Request) { | ||
| const cookie = request.cookies['jwt']; | ||
| const { id: user_id } = await this.jwtService.verifyAsync(cookie); | ||
| const user = await this.userService.findOne({ where: { user_id } }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will be catered in auth.middleware.
no need for this so pls remove.
| if (user) { | ||
| return formattedData; | ||
| } else { | ||
| throw new NotFoundException('Forbidden Resources'); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also remove this condition
| signOptions: { expiresIn: '1d' }, | ||
| }), | ||
| TypeOrmModule.forFeature([Category, Words, Choices, User]), | ||
| TypeOrmModule.forFeature([Category, Words, Choices,User]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change is not necessary. pls rever it back to original
| }), | ||
| TypeOrmModule.forFeature([Category, Words, Choices, User]), | ||
| TypeOrmModule.forFeature([Category, Words, Choices,User]), | ||
| ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think code still formatted. can you setup prettier.
| import { In } from 'typeorm'; | ||
| import { AuthGuard } from 'src/auth/auth.guard'; | ||
| import { Request } from 'express'; | ||
| import { request } from 'http'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls remove this , since request is not being use.
| private choicesService: ChoicesService, | ||
| private jwtService: JwtService, | ||
| private userService: UserService | ||
| private readonly userService: UserService |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove readonly
ddd190a to
ef98c2e
Compare
ef98c2e to
3744cf2
Compare

Asana
[Commands]
docker compose up[Pre-conditions]
[Expected Output]
[Screenshots]
Details