Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/authz-module/authz-home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ const AuthzHome = () => {
const { hash } = useLocation();
const intl = useIntl();
const [searchParams] = useSearchParams();
const presetScope = searchParams.get('scope') || undefined;

/* In the authoring repository the scope is encoded but this is to Replace spaces with '+'
to match URL encoding format in case the 'scope' parameter is provided with spaces instead of '+'
*/
const presetScope = searchParams.get('scope')?.replace(/\s/g, '+') || undefined;

@rodmgwgu rodmgwgu Apr 23, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This works here because course and library key parts (org, run, number), don't accept spaces or special characters. Otherwise, this would potentially break keys with spaces (which is not the case).

However the root cause of this issue is that we are not url-encoding the query params on the links generated in frontend-app-authoring.

If we did that, the course key would be encoded as "course-v1%3AOpenedX%2BDemoX%2BDemoCourse", and on decode, it will come back correctly here as + instead of spaces.

We can keep this change as a fallback, but I think we should fix the root cause in frontend-app-authoring

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

thanks @rodmgwgu , I checked first on authoring and I saw the URL correctly there, but let me double check.
agreed that we should use encodeURI on authoring repo.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@rodmgwgu you were right, I've added the change to this PR
openedx/frontend-app-authoring#3023
and it works correct, thanks!


const pageTitle = intl.formatMessage(messages['authz.manage.page.title']);

Expand Down