Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F545306
PhabricatorConduitTokenHandshakeController.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
PhabricatorConduitTokenHandshakeController.php
View Options
<?php
final
class
PhabricatorConduitTokenHandshakeController
extends
PhabricatorConduitController
{
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$request
->
getViewer
();
id
(
new
PhabricatorAuthSessionEngine
())->
requireHighSecuritySession
(
$viewer
,
$request
,
'/'
);
$unguarded
=
AphrontWriteGuard
::
beginScopedUnguardedWrites
();
$token
=
PhabricatorConduitToken
::
initializeNewToken
(
$viewer
->
getPHID
(),
PhabricatorConduitToken
::
TYPE_COMMANDLINE
);
$token
->
save
();
unset
(
$unguarded
);
$form
=
id
(
new
AphrontFormView
())
->
setUser
(
$viewer
)
->
appendRemarkupInstructions
(
pht
(
'Copy-paste the API Token below to grant access to your account.'
))
->
appendChild
(
id
(
new
AphrontFormTextControl
())
->
setLabel
(
pht
(
'API Token'
))
->
setValue
(
$token
->
getToken
()))
->
appendRemarkupInstructions
(
pht
(
'This will authorize the requesting script to act on your behalf '
.
'permanently, like giving the script your account password.'
))
->
appendRemarkupInstructions
(
pht
(
'If you change your mind, you can revoke this token later in '
.
'{nav icon=wrench,name=Settings > Conduit API Tokens}.'
));
return
$this
->
newDialog
()
->
setTitle
(
pht
(
'Grant Account Access'
))
->
setWidth
(
AphrontDialogView
::
WIDTH_FULL
)
->
appendForm
(
$form
)
->
addCancelButton
(
'/'
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 12:46 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
97089
Default Alt Text
PhabricatorConduitTokenHandshakeController.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment