Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/factor/PhabricatorAuthFactor.php
Show First 20 Lines • Show All 135 Lines • ▼ Show 20 Lines | final public function getNewIssuedChallenges( | ||||
// challenges, particularly push factors like SMS. | // challenges, particularly push factors like SMS. | ||||
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); | $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); | ||||
$new_challenges = $this->newIssuedChallenges( | $new_challenges = $this->newIssuedChallenges( | ||||
$config, | $config, | ||||
$viewer, | $viewer, | ||||
$challenges); | $challenges); | ||||
if ($new_challenges instanceof PhabricatorAuthFactorResult) { | |||||
unset($unguarded); | |||||
return $new_challenges; | |||||
} | |||||
assert_instances_of($new_challenges, 'PhabricatorAuthChallenge'); | assert_instances_of($new_challenges, 'PhabricatorAuthChallenge'); | ||||
foreach ($new_challenges as $new_challenge) { | foreach ($new_challenges as $new_challenge) { | ||||
$ttl = $new_challenge->getChallengeTTL(); | $ttl = $new_challenge->getChallengeTTL(); | ||||
if (!$ttl) { | if (!$ttl) { | ||||
throw new Exception( | throw new Exception( | ||||
pht('Newly issued MFA challenges must have a valid TTL!')); | pht('Newly issued MFA challenges must have a valid TTL!')); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 336 Lines • ▼ Show 20 Lines | final protected function newQRCode($uri) { | ||||
return phutil_tag( | return phutil_tag( | ||||
'table', | 'table', | ||||
array( | array( | ||||
'style' => 'margin: 24px auto;', | 'style' => 'margin: 24px auto;', | ||||
), | ), | ||||
$rows); | $rows); | ||||
} | } | ||||
final protected function throwResult(PhabricatorAuthFactorResult $result) { | |||||
throw new PhabricatorAuthFactorResultException($result); | |||||
} | |||||
final protected function getInstallDisplayName() { | final protected function getInstallDisplayName() { | ||||
$uri = PhabricatorEnv::getURI('/'); | $uri = PhabricatorEnv::getURI('/'); | ||||
$uri = new PhutilURI($uri); | $uri = new PhutilURI($uri); | ||||
return $uri->getDomain(); | return $uri->getDomain(); | ||||
} | } | ||||
final protected function getChallengeResponseParameterName( | final protected function getChallengeResponseParameterName( | ||||
PhabricatorAuthFactorConfig $config) { | PhabricatorAuthFactorConfig $config) { | ||||
Show All 39 Lines |