Implement OTP page in config

a
This commit is contained in:
Yukino Song
2024-08-28 03:04:50 +08:00
parent 86e707618f
commit b8d3ebb248
6 changed files with 87 additions and 13 deletions

View File

@@ -619,10 +619,10 @@ namespace nvhttp {
tree.put("root.<xmlattr>.status_code", 503);
tree.put("root.<xmlattr>.status_message", "OTP auth not available.");
} else {
auto hash = util::hex(crypto::hash(one_time_pin + ptr->second.async_insert_pin.salt + otp_passphrase));
auto hash = util::hex(crypto::hash(one_time_pin + ptr->second.async_insert_pin.salt + otp_passphrase), true);
if (hash.to_string_view() == it->second) {
getservercert(ptr->second, tree, one_time_pin);
pin(one_time_pin, deviceName);
one_time_pin.clear();
otp_passphrase.clear();
return;