geforkt von mirrored/vaultwarden
Fix #242
Dieser Commit ist enthalten in:
Ursprung
66a4c5d48b
Commit
b94f4db52a
1 geänderte Dateien mit 12 neuen und 3 gelöschten Zeilen
|
@ -132,9 +132,18 @@ pub struct CipherData {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[post("/ciphers/admin", data = "<data>")]
|
#[post("/ciphers/admin", data = "<data>")]
|
||||||
fn post_ciphers_admin(data: JsonUpcase<CipherData>, headers: Headers, conn: DbConn, ws: State<WebSocketUsers>) -> JsonResult {
|
fn post_ciphers_admin(data: JsonUpcase<ShareCipherData>, headers: Headers, conn: DbConn, ws: State<WebSocketUsers>) -> JsonResult {
|
||||||
// TODO: Implement this correctly
|
let data: ShareCipherData = data.into_inner().data;
|
||||||
post_ciphers(data, headers, conn, ws)
|
|
||||||
|
let mut cipher = Cipher::new(data.Cipher.Type.clone(), data.Cipher.Name.clone());
|
||||||
|
cipher.user_uuid = Some(headers.user.uuid.clone());
|
||||||
|
match cipher.save(&conn) {
|
||||||
|
Ok(()) => (),
|
||||||
|
Err(_) => err!("Failed saving cipher")
|
||||||
|
};
|
||||||
|
|
||||||
|
share_cipher_by_uuid(&cipher.uuid, data, &headers, &conn, &ws)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[post("/ciphers", data = "<data>")]
|
#[post("/ciphers", data = "<data>")]
|
||||||
|
|
Laden …
In neuem Issue referenzieren