mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-11-26 11:53:31 +03:00
Merge pull request #484 from kinode-dao/dr/import-keyfile-fix
fix import keyfile!
This commit is contained in:
commit
e1573a793a
@ -62,7 +62,7 @@ function ImportKeyfile({
|
||||
credentials: 'include',
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
keyfile: Buffer.from(localKey).toString('base64'),
|
||||
keyfile: Buffer.from(localKey).toString('utf8'),
|
||||
password_hash: hashed_password,
|
||||
}),
|
||||
});
|
||||
|
@ -443,6 +443,7 @@ async fn handle_import_keyfile(
|
||||
sender: Arc<RegistrationSender>,
|
||||
provider: Arc<RootProvider<PubSubFrontend>>,
|
||||
) -> Result<impl Reply, Rejection> {
|
||||
println!("received base64 keyfile: {}\r", info.keyfile);
|
||||
// if keyfile was not present in node and is present from user upload
|
||||
let encoded_keyfile = match base64_standard.decode(info.keyfile) {
|
||||
Ok(k) => k,
|
||||
@ -455,6 +456,10 @@ async fn handle_import_keyfile(
|
||||
}
|
||||
};
|
||||
|
||||
println!(
|
||||
"received keyfile: {}\r",
|
||||
String::from_utf8_lossy(&encoded_keyfile)
|
||||
);
|
||||
let (decoded_keyfile, mut our) =
|
||||
match keygen::decode_keyfile(&encoded_keyfile, &info.password_hash) {
|
||||
Ok(k) => {
|
||||
|
Loading…
Reference in New Issue
Block a user