diff --git a/api/actions/addapppassword.php b/api/actions/addapppassword.php new file mode 100644 index 0000000..356e0d2 --- /dev/null +++ b/api/actions/addapppassword.php @@ -0,0 +1,14 @@ +insert('apppasswords', ['uid' => User::byUsername($VARS['username'])->getUID(), 'hash' => password_hash($chunk_code, PASSWORD_DEFAULT), 'description' => $desc]); + +sendJsonResp("", "OK", ["pass" => $chunk_code]); diff --git a/api/apisettings.php b/api/apisettings.php index 810c674..a4ee992 100644 --- a/api/apisettings.php +++ b/api/apisettings.php @@ -255,5 +255,13 @@ $APIS = [ "code" => "string" ], "keytype" => "AUTH" - ] + ], + "addapppassword" => [ + "load" => "addapppassword.php", + "vars" => [ + "desc" => "string", + "username" => "string" + ], + "keytype" => "FULL" + ], ];