Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-75064

OAuth2 client should not take a returnurl in the constructor

      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

            Unassigned Unassigned
            jeremyvignelles jeremyVignelles
            Andrew Lyons Andrew Lyons
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 46 minutes
                46m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.