Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101483413
PhabricatorAuthChallengeStatusController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Feb 10, 21:47
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Feb 12, 21:47 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24161627
Attached To
rPH Phabricator
PhabricatorAuthChallengeStatusController.php
View Options
<?php
final
class
PhabricatorAuthChallengeStatusController
extends
PhabricatorAuthController
{
public
function
shouldAllowPartialSessions
()
{
// We expect that users may request the status of an MFA challenge when
// they hit the session upgrade gate on login.
return
true
;
}
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$this
->
getViewer
();
$id
=
$request
->
getURIData
(
'id'
);
$now
=
PhabricatorTime
::
getNow
();
$result
=
new
PhabricatorAuthChallengeUpdate
();
$challenge
=
id
(
new
PhabricatorAuthChallengeQuery
())
->
setViewer
(
$viewer
)
->
withIDs
(
array
(
$id
))
->
withUserPHIDs
(
array
(
$viewer
->
getPHID
()))
->
withChallengeTTLBetween
(
$now
,
null
)
->
executeOne
();
if
(
$challenge
)
{
$config
=
id
(
new
PhabricatorAuthFactorConfigQuery
())
->
setViewer
(
$viewer
)
->
withPHIDs
(
array
(
$challenge
->
getFactorPHID
()))
->
executeOne
();
if
(
$config
)
{
$provider
=
$config
->
getFactorProvider
();
$factor
=
$provider
->
getFactor
();
$result
=
$factor
->
newChallengeStatusView
(
$config
,
$provider
,
$viewer
,
$challenge
);
}
}
return
id
(
new
AphrontAjaxResponse
())
->
setContent
(
$result
->
newContent
());
}
}
Event Timeline
Log In to Comment