mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[feature/oauth] OAuth clear tokens on logout
PHPBB3-11673
This commit is contained in:
parent
2222f3f380
commit
e16dd958e3
1 changed files with 14 additions and 0 deletions
|
@ -419,4 +419,18 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
|
||||||
// Update token storage to store the user_id
|
// Update token storage to store the user_id
|
||||||
$storage->set_user_id($link_data['user_id']);
|
$storage->set_user_id($link_data['user_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function logout($data, $new_session)
|
||||||
|
{
|
||||||
|
// Clear all tokens belonging to the user
|
||||||
|
$sql = 'DELETE FROM ' . $this->auth_provider_oauth_token_storage_table . "
|
||||||
|
WHERE session_id = '" . $this->db->sql_escape($this->user->session_id) . "'
|
||||||
|
AND user_id = " . (int) $this->user->data['user_id'];
|
||||||
|
$this->db->sql_query($sql);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue