Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F548999
PhabricatorAuthLogoutConduitAPIMethod.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorAuthLogoutConduitAPIMethod.php
View Options
<?php
final
class
PhabricatorAuthLogoutConduitAPIMethod
extends
PhabricatorAuthConduitAPIMethod
{
public
function
getAPIMethodName
()
{
return
'auth.logout'
;
}
public
function
getMethodSummary
()
{
return
pht
(
'Terminate all login sessions.'
);
}
public
function
getMethodDescription
()
{
return
pht
(
'Terminate all web login sessions. If called via OAuth, also terminate '
.
'the current OAuth token.'
.
"
\n\n
"
.
'WARNING: This method does what it claims on the label. If you call '
.
'this method via the test console in the web UI, it will log you out!'
);
}
protected
function
defineParamTypes
()
{
return
array
();
}
protected
function
defineReturnType
()
{
return
'void'
;
}
public
function
getRequiredScope
()
{
return
self
::
SCOPE_ALWAYS
;
}
protected
function
execute
(
ConduitAPIRequest
$request
)
{
$viewer
=
$request
->
getUser
();
// Destroy all web sessions.
$engine
=
id
(
new
PhabricatorAuthSessionEngine
());
$engine
->
terminateLoginSessions
(
$viewer
);
// If we were called via OAuth, destroy the OAuth token.
$oauth_token
=
$request
->
getOAuthToken
();
if
(
$oauth_token
)
{
$oauth_token
->
delete
();
}
return
null
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 1:58 PM (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
119882
Default Alt Text
PhabricatorAuthLogoutConduitAPIMethod.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment