kolibri
kolibri copied to clipboard
Quiz creation route not redirecting to user_auth on 401/403
Overview
I've found when I step away from working on the quiz creation project that if my session has timed out then I just get a blank screen.
The expectation on a permissions error response is that we ship the user to the sign in page with a query param next
which is set to the path that the user was trying to access.
Once the user signs in, they're redirected back to where they're trying to go in the first place.
Guidance, Replication
This seems to occur in multiple places in Coach -- I've confirmed it during Lesson creation & Quiz creation.
- On
develop
branch - Sign in as an admin/coach, navigate to the Coach > Class > Plan > Quizzes > New Quiz
- Go to your cookies in the devtools and delete the cookies, then quickly refresh the page (this emulates the session timeout situation consistently in my attempts)
- The thing that really makes this a problem is that refreshing again and again results in the same blank page.
Look into this part of the Learn router for inspiration. We may consider adding something similar to the coach app's beforeEach router guard as well -- but note that we'll only really want to check if the user is logged in there.
This solution will not directly handle the 401 -- however, it will properly send the user to the AuthMessage, which they can then click to access the sign in page w/ the proper ?next
parameter
Acceptance criteria
- [ ] Signing out due to inactivity doesn't result in being stuck on a blank page during Quiz Creation (or any other part of Coach)
@nucleogenesis @MisRob i would like to work on this issue , if it is open for contribution
Hi @GarvitSinghal47, we've just assigned you the other issue you asked for. If you're still interested in this one later on, please message us again. Thank you for all your work.
Can I work on this issue now? @MisRob
Hi @GarvitSinghal47, thank you for volunteering, I will assign you
I've moved this issue back into the Backlog as the associated PR has not had movement in several weeks. Hopefully whoever takes this on can follow-up on @GarvitSinghal47 's work in #11875 -