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!