Skip to content

Conversation

@Fontilllas
Copy link
Contributor

Asana

[Commands]

  • docker compose up

[Pre-conditions]

  1. After running the command , you can now access the Postman and Dbeaver.
  2. Go to admin/login or student/login
  3. If you want to sign in as a student you must logout first before opening 'student/word/:wordId' same as well in the admin.
  4. Go to 'student/word/:wordId', 'admin/word/:wordId'

[Expected Output]

  • Verify if Both User and Admin can only access the Lesson quiz after log in and access to existing category

[Screenshots]

Details

image

image

image

image

@Fontilllas Fontilllas self-assigned this Dec 21, 2023
@Fontilllas Fontilllas force-pushed the SPH-ELS-MARK-25 branch 2 times, most recently from 5ace4dd to 72ab404 Compare January 8, 2024 09:03
@Mjdelima20
Copy link
Collaborator

I encountered some errors after running docker compose up on my end. Please fix.

image

@Fontilllas Fontilllas force-pushed the SPH-ELS-MARK-25 branch 2 times, most recently from a002c38 to 6b7c269 Compare January 12, 2024 11:55
private choicesService: ChoicesService,
private jwtService: JwtService,
private userService: UserService
private readonly userService: UserService,
Copy link
Collaborator

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 } });
Copy link
Collaborator

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.

Comment on lines 100 to 104
if (user) {
return formattedData;
} else {
throw new NotFoundException('Forbidden Resources');
}
Copy link
Collaborator

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]),
Copy link
Collaborator

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]),
],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import { In } from 'typeorm';
import { AuthGuard } from 'src/auth/auth.guard';
import { Request } from 'express';
import { request } from 'http';
Copy link
Collaborator

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove readonly

@Fontilllas Fontilllas changed the title [SELS-TASK] [BE]- Enable Authguards for the Lesson Quiz endpoint [SELS-TASK-25] [BE]- Enable Authguards for the Lesson Quiz endpoint Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants