Clear the kolab_files_token on oauth token refresh
Summary: This will force a new chwala session, which will update the oauth token used by chwala. Differential Revision: https://git.kolab.org/D5130
This commit is contained in:
parent
1072c6303f
commit
08ae04a4e8
1 changed files with 15 additions and 0 deletions
|
@ -36,8 +36,14 @@ class kolab_files extends rcube_plugin
|
|||
{
|
||||
$this->rc = rcube::get_instance();
|
||||
|
||||
if (isset($this->rc->oauth)) {
|
||||
// This will trigger oauth_refresh_token if necessary
|
||||
$this->rc->oauth->is_token_valid();
|
||||
}
|
||||
|
||||
// Register hooks
|
||||
$this->add_hook('refresh', [$this, 'refresh']);
|
||||
$this->add_hook('oauth_refresh_token', [$this, 'oauth_refresh_token']);
|
||||
|
||||
// Plugin actions for other tasks
|
||||
$this->register_action('plugin.kolab_files', [$this, 'actions']);
|
||||
|
@ -129,6 +135,15 @@ class kolab_files extends rcube_plugin
|
|||
return $args;
|
||||
}
|
||||
|
||||
/**
|
||||
* oauth_refresh_token hook handler
|
||||
*/
|
||||
public function oauth_refresh_token($args)
|
||||
{
|
||||
// Force a new chwala session, which will update the credentials (which hold the oauth token)
|
||||
$_SESSION['kolab_files_token'] = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Engine actions handler
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue