How to hook course learning requests?


At UAMx we need the users to accept the terms and conditions after authenticating in the platform, as a simple form with a checkbox saying “I accept the Terms and Conditions”

To do so we have implemented a Django plugin with the proper django app, which exposes a url with the form and has a middleware to listen to a number of paths and redirect the user to the acceptance form.

The fact is that this middleware works fine for paths like “dashboard”, “courses”, “account/settings”, etc… but it doesn’t seem to work with “learning” paths. This is annoying because the “learning” path is mostly the only one used by any of our users…

I think it can be related with the fact that the learning path is an MFE and for some reason middlewares do not apply there :frowning:

So, is there any way to capture requests made to an MFE like learning?

I was thinking about adding an AUTHENTICATION_BACKEND to preform this redirection, but as middleware apparently affects to every request I just let it go.

Thanks in advance for any help

PD: Just in case, I already tried with filters (but apparently there was none that cover my requirements) and signals (but I was unable to redirect inside signals)

Can you update the AuthN MFE instead? GitHub - openedx/frontend-app-authn: Open edX micro-frontend application for new login and registration experience.

You can just have them accept the TOS on registration in that case? If you’re registering them some other way, then maybe you can update the login flow before they go anywhere else?

Thanks @feanil for the tip.

I am not used to modify MFEs in general, but it sure has interesting things. I’ve seen there is a variable called AUTHN_PROGRESSIVE_PROFILING that sounds just like what I need.