campaignd: Record the hashed passphrase for new uploads
Otherwise no passphrase is recorded into the server config and it becomes impossible to reupload the add-on without admin assistance.
This commit is contained in:
parent
2278219348
commit
e399258b44
1 changed files with 6 additions and 0 deletions
|
@ -721,6 +721,8 @@ void server::handle_upload(const server::request& req)
|
|||
return;
|
||||
}
|
||||
|
||||
const bool existing_upload = campaign != NULL;
|
||||
|
||||
std::string message = "Add-on accepted.";
|
||||
|
||||
if(campaign == NULL) {
|
||||
|
@ -741,6 +743,10 @@ void server::handle_upload(const server::request& req)
|
|||
(*campaign)["type"] = upload["type"];
|
||||
(*campaign)["email"] = upload["email"];
|
||||
|
||||
if(!existing_upload) {
|
||||
set_passphrase(*campaign, upload["passphrase"]);
|
||||
}
|
||||
|
||||
if((*campaign)["downloads"].empty()) {
|
||||
(*campaign)["downloads"] = 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue