username required default (none)Login name of the user whose 2FA secret is being set. Must match an existing user, and must resolve to the SAME user who is currently logged in - you can only re-confirm your own account.
password required default (none)Current password of that same user. Re-checked here so a logged-in session must prove the password again before a secret is generated. Stored content is never echoed.
code2fa optional default (empty)The current 6-digit code from the user's authenticator app. Required only if the account already has a 2FA secret (then the code must verify); leave empty for an account that has none yet.
[{setsecret:alice:s3cr3t:123456}]
[{setsecret:somebody:wrong-password:000000}]
[{setsecret:::}]
{setsecret:_#USERNAME:_#PASSWORD:_#CODE2FA}
{setsecret:alice:s3cr3t:{getcode2fa}}