-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
3.11.7, 4.0.1
-
MOODLE_311_STABLE, MOODLE_400_STABLE
-
refactor/oauth-redirect-url
-
The oauth2_client class (and all its derived implementation) takes a `moodle_url $returnurl` in its constructor parameter. The $this->returnurl is only used in the context of login, through the `get_login_url()` method.
When implementing a logout OAuth client, you need to pass that redirecturl, which is not used. I argue this is a code smell, that can be fixed this way:
- Remove the $redirecturl parameter from all the constructors for oauth clients
- Remove the $redirecturl field from the class
- Pass a $redirecturl argument into the get_login_url function, where it's really used
- Edit the get_user_oauth_client function to remove the $currenturl parameter
- remove the $overrideurl in the get_user_oauth_client method in /repository/{googledocs,nextcloud,onedrive}/lib.php
- Find a way to pass the returnurl to the get_login_url(). This should be doable everywhere I've seen
Patch incoming