26 $session_token =
get_input(
'session_token', null,
false);
27 $pairs = (array)
get_input(
'pairs', [],
false);
28 $valid_tokens = (object) [];
30 foreach ($pairs as $pair) {
31 list(
$ts,
$token) = explode(
',', $pair, 2);
33 $valid_tokens->{
$token} =
true;
46 'valid_tokens' => $valid_tokens,
47 'session_token' =>
_elgg_services()->session->get(
'__elgg_session'),
48 'user_guid' =>
_elgg_services()->session_manager->getLoggedInUserGuid(),
52 $response->headers->set(
'Content-Type',
'application/json;charset=utf-8',
true);
53 $response->headers->set(
'X-Content-Type-Options',
'nosniff',
true);
if(!$entity instanceof\ElggUser) $data
Handles requests to /refresh_token.
$ts
CSRF security token view for use with secure forms.
_elgg_services()
Get the global service provider.
__invoke(\Elgg\Http\Request $request)
Send an updated CSRF token, provided the page's current tokens were not fake.