Skip to content
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

fix: Handle session timeout during Quiz Creation in Coach #11875

Closed
Changes from 1 commit
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
12 changes: 12 additions & 0 deletions kolibri/plugins/coach/assets/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,18 @@ class CoachToolsModule extends KolibriApp {
} else {
next();
}

if (!this.store.getters.isUserLoggedIn) {
Copy link
Member

Choose a reason for hiding this comment

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

Hrm, it might be worth investigating the withAuthMessage component defined here:

export default function withAuthMessage(component, authorizedRole) {
(search the code base for other uses), alternatively, the AuthMessage component can be used inside the Coach index page.

This particular implementation will kind of work, although I am fairly sure the next query parameter will be lost during the redirect to the auth page.

It is also possible for Kolibri to be configured to redirect unauthenticated users to the Learn page, so in that case, this redirect will not prompt someone to login.

Copy link
Member

Choose a reason for hiding this comment

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

@GarvitSinghal47 -- would you be able to revise this PR according to the feedback above?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nucleogenesis , my apologies for the oversight. I completely forgot about this open pull request. I will make the necessary adjustments and provide the updates promptly.

const currentURL = window.encodeURIComponent(window.location.href);
router.replace({
path: '/',
query: {
next: currentURL,
},
});
} else {
next();
}
});

router.afterEach((toRoute, fromRoute) => {
Expand Down