Hi @Friendica Support
Next bug I found (I think ;)):
When 2FA is enabled and I'm trying to add a new app password (on settings/2fa/app_specific
)the process fails with a blank page (where normally the new app password is displayed) and the following error:
Uncaught Exception TypeError: "Argument 1 passed to Friendica\Util\Temporal::getRelativeDate() must be of the type string, null given, called in src/Security/TwoFactor/Model/AppSpecificPassword.php on line 89" at src/Util/Temporal.php line 314
In addition the 2FA page with the active app passwords now fails completely (white page) until the 2fa_app_specific_password
table is edited manually by removing the entries with empty last_used
field - filling the field should work, too.
It seems the problem is the field last_used
in the database table 2fa_app_specific_password
. When creating a new app password this field is initially blank. This seems to be a problem for the function getListForUser($uid)
since when I comment out the follwing lines everything is working again:
$value['ago'] = Temporal::getRelativeDate($value['last_used']);
$value['utc'] = $value['last_used'] ? DateTimeFormat::utc($value['last_used'], 'c') : '';
$value['local'] = $value['last_used'] ? DateTimeFormat::local($value['last_used'], 'r') : '';
Friendica version is 2022.10.