Skip to content

Conversation

@ozer550
Copy link
Member

@ozer550 ozer550 commented Sep 4, 2025

Summary

  • Handle invalid lesson_id errors by stripping query params for learners not assigned to the lesson

References

closes #12061

Reviewer guidance

  • Create a class with two learners.
  • Assign one of the learner a lesson with resource like a pdf.
  • Open the resource from the assigned learner and copy the url.
  • Check if you can preview the same resource using the URL from a newly created user and from the other user assigned to class.

@github-actions github-actions bot added APP: Learn Re: Learn App (content, quizzes, lessons, etc.) DEV: frontend SIZE: small labels Sep 4, 2025
error.response.data.includes('Invalid lesson_id')
) {
this.$router.replace({ ...this.$route, query: null });
return this.initContentSession({
Copy link
Member

Choose a reason for hiding this comment

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

Did it not work to just call initSession() here again? If not, we can instead pass it as the second argument as an onComplete callback for the navigation: https://v3.router.vuejs.org/guide/essentials/navigation.html

So the line above would be:
this.$router.replace({ ...this.$route, query: null }, this.initSession);

Copy link
Member Author

@ozer550 ozer550 Sep 11, 2025

Choose a reason for hiding this comment

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

Surprisingly, this does not work even after I set query: null. Are there any downsides of current implementation?

@rtibbles rtibbles self-assigned this Sep 9, 2025
@rtibbles
Copy link
Member

Code checks out, just needs manual QA to confirm the fix here!

@pcenov pcenov self-requested a review September 12, 2025 13:28
Copy link
Member

@pcenov pcenov left a comment

Choose a reason for hiding this comment

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

Thanks @ozer550, I confirm that the issue reported in #12061 is fixed now.

@rtibbles rtibbles merged commit 885be1a into learningequality:develop Sep 15, 2025
54 of 55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

APP: Learn Re: Learn App (content, quizzes, lessons, etc.) DEV: frontend SIZE: small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Signed in user is not properly redirected when using a URL with lessonId or classId

3 participants