Added check if the peer is enabled and if it uses a password, a password check is required to set the otp post registration
This commit is contained in:
parent
7809f32a5e
commit
b1c669dfa8
1 changed files with 12 additions and 4 deletions
|
@ -37,14 +37,22 @@
|
||||||
throw new StandardException('Failed to check One Time Password due to an internal exception', StandardError::INTERNAL_SERVER_ERROR, $e);
|
throw new StandardException('Failed to check One Time Password due to an internal exception', StandardError::INTERNAL_SERVER_ERROR, $e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($peer->isEnabled())
|
||||||
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
// If the peer is disabled, the password is not used because we assume the peer is registering
|
||||||
$usesPassword = PasswordManager::usesPassword($peer);
|
$usesPassword = PasswordManager::usesPassword($peer);
|
||||||
}
|
}
|
||||||
catch (DatabaseOperationException $e)
|
catch (DatabaseOperationException $e)
|
||||||
{
|
{
|
||||||
throw new StandardException('Failed to check password usage due to an internal exception', StandardError::INTERNAL_SERVER_ERROR, $e);
|
throw new StandardException('Failed to check password usage due to an internal exception', StandardError::INTERNAL_SERVER_ERROR, $e);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$usesPassword = false;
|
||||||
|
}
|
||||||
|
|
||||||
// Password verification is required to set an OTP if a password is set
|
// Password verification is required to set an OTP if a password is set
|
||||||
if($usesPassword)
|
if($usesPassword)
|
||||||
|
|
Loading…
Add table
Reference in a new issue