catalyst / moodle-auth_userkey

Log in to Moodle using one time user key based login URL. Auth plugin for organising simple SSO (single sign on) between moodle and your external web application.
https://moodle.org/plugins/auth_userkey
83 stars 53 forks source link

Customize function loginpage_hook to redirect Requested URL #54

Open miguelurtado opened 4 years ago

miguelurtado commented 4 years ago

Suggestion: create settings and change function loginpage_hook to send wantsurl as parameter to return in API login URL.

    public function loginpage_hook() {
        global $SESSION;

        if ($this->should_login_redirect()) {
            $this->redirect($this->config->ssourl . "?wantsurl=" . $SESSION->wantsurl );
        }

        return true;
    }

Thanks for this plugin!

dmitriim commented 4 years ago

@miguelurtado thanks for the suggestion. Can you please describe the user case you would need this for better understanding? And please feel free to submit a proper patch.