Skip to content

fix: restore access to confirm mentor registration#2870

Draft
aliakseitokarev wants to merge 4 commits intomasterfrom
fix/mentor-confirm-access
Draft

fix: restore access to confirm mentor registration#2870
aliakseitokarev wants to merge 4 commits intomasterfrom
fix/mentor-confirm-access

Conversation

@aliakseitokarev
Copy link
Copy Markdown
Contributor

@aliakseitokarev aliakseitokarev commented Nov 11, 2025

Pull Request Guidelines

Issue:
Mentor can't accept the invitation.

Description:
Add the mentorConfirmRoute to ActiveCourseProvider, incorporating the necessary checks.

Self-Check:

  • Database migration added (if required)
  • Changes tested locally

}
const courseToConfirm = await new CoursesApi().getCourseByAlias(alias as string);
const isInvited = mentor?.preselectedCourses?.includes(courseToConfirm?.data.id) ?? false;
return isInvited;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How about:

return !!mentor?.preselectedCourses?.includes(courseToConfirm?.data.id);

<ActiveCourseProvider
publicRoutes={['/login', '/registry/mentor', '/registry/student', '/course/mentor/confirm']}
publicRoutes={['/login', '/registry/mentor', '/registry/student']}
mentorConfirmRoute="/course/mentor/confirm"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This route was excluded from the publicRoutes, but some children render depends on publicRoutes:

   if (isPublicRoute && router.isReady) {
     return <>{children}</>;
   }

Is it expected?

@ApiForbiddenResponse()
@ApiOkResponse({ type: CourseDto })
@UseGuards(DefaultGuard)
public async getByAlias(@Req() _: CurrentRequest, @Param('courseAlias') courseAlias: string) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does the request object used here?

@aliakseitokarev aliakseitokarev marked this pull request as draft November 12, 2025 22:46
@AlreadyBored AlreadyBored marked this pull request as ready for review November 17, 2025 21:27
@aliakseitokarev aliakseitokarev marked this pull request as draft November 22, 2025 22:31
@AlreadyBored AlreadyBored marked this pull request as ready for review November 23, 2025 18:30
@AlreadyBored
Copy link
Copy Markdown
Contributor

@aliakseitokarev please resolve code review concers and merge conflicts and we're good to go :)

@aliakseitokarev aliakseitokarev marked this pull request as draft December 2, 2025 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants