Skip to content

Commit 994312d

Browse files
committed
Fix Psalm issues
1 parent 71b91df commit 994312d

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

lib/Auth/Source/YubiKey.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ public static function handleLogin($authStateId, $otp)
137137

138138
/* Retrieve the authentication state. */
139139
$state = \SimpleSAML\Auth\State::loadState($authStateId, self::STAGEID);
140+
if (is_null($state)) {
141+
throw new \SimpleSAML\Error\NoState();
142+
}
140143

141144
/* Find authentication source. */
142145
Assert::keyExists($state, self::AUTHID);

www/yubikeylogin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
$t = new \SimpleSAML\XHTML\Template($globalConfig, 'authYubiKey:yubikeylogin.php');
1919
$translator = $t->getTranslator();
2020

21-
$errorCode = null;
21+
$errorCode = [];
2222
if (array_key_exists('otp', $_REQUEST)) {
2323
// attempt to log in
2424
$errorCode = \SimpleSAML\Module\authYubiKey\Auth\Source\YubiKey::handleLogin($authStateId, $_REQUEST['otp']);

0 commit comments

Comments
 (0)