Skip to content

Commit

Permalink
Remove webauthn debug (#593)
Browse files Browse the repository at this point in the history
  • Loading branch information
broody authored Aug 16, 2024
1 parent 108effe commit 11a5a90
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 26 deletions.
18 changes: 9 additions & 9 deletions packages/account-wasm/pkg/account_wasm_bg.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,8 @@ export function __wbindgen_string_get(arg0, arg1) {
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
};

export function __wbindgen_string_new(arg0, arg1) {
const ret = getStringFromWasm0(arg0, arg1);
export function __wbindgen_error_new(arg0, arg1) {
const ret = new Error(getStringFromWasm0(arg0, arg1));
return addHeapObject(ret);
};

Expand All @@ -499,11 +499,6 @@ export function __wbindgen_object_clone_ref(arg0) {
return addHeapObject(ret);
};

export function __wbindgen_error_new(arg0, arg1) {
const ret = new Error(getStringFromWasm0(arg0, arg1));
return addHeapObject(ret);
};

export function __wbindgen_is_undefined(arg0) {
const ret = getObject(arg0) === undefined;
return ret;
Expand Down Expand Up @@ -571,6 +566,11 @@ export function __wbindgen_number_new(arg0) {
return addHeapObject(ret);
};

export function __wbindgen_string_new(arg0, arg1) {
const ret = getStringFromWasm0(arg0, arg1);
return addHeapObject(ret);
};

export function __wbg_getwithrefkey_edc2c8960f0f1191(arg0, arg1) {
const ret = getObject(arg0)[getObject(arg1)];
return addHeapObject(ret);
Expand Down Expand Up @@ -1042,8 +1042,8 @@ export function __wbindgen_memory() {
return addHeapObject(ret);
};

export function __wbindgen_closure_wrapper2279(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 490, __wbg_adapter_48);
export function __wbindgen_closure_wrapper2255(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 489, __wbg_adapter_48);
return addHeapObject(ret);
};

Binary file modified packages/account-wasm/pkg/account_wasm_bg.wasm
Binary file not shown.
3 changes: 1 addition & 2 deletions packages/account-wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ use starknet::macros::short_string;
use starknet::signers::SigningKey;
use url::Url;
use wasm_bindgen::prelude::*;
use web_sys::console;

use crate::errors::OperationError;
use crate::types::invocation::JsInvocationsDetails;
Expand Down Expand Up @@ -210,7 +209,7 @@ impl CartridgeAccount {
.into_iter()
.map(Call::try_from_js_value)
.collect::<std::result::Result<_, _>>()?;
console::log_1(&format!("{:#?}", calls).into());

Ok(self.controller.session_account(&calls).is_some())
}

Expand Down
21 changes: 6 additions & 15 deletions packages/account-wasm/src/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ use account_sdk::{
OriginProvider,
};
use futures::channel::oneshot;
use serde_json::to_value;
use wasm_bindgen::UnwrapThrowExt;
use wasm_bindgen_futures::{spawn_local, JsFuture};
use web_sys::{console, Window};
use web_sys::Window;
use webauthn_rs_proto::{
auth::PublicKeyCredentialRequestOptions, CreationChallengeResponse, PublicKeyCredential,
PublicKeyCredentialCreationOptions, RegisterPublicKeyCredential, RequestChallengeResponse,
Expand Down Expand Up @@ -48,12 +47,9 @@ impl WebauthnBackend for BrowserBackend {

match JsFuture::from(promise).await {
Ok(jsval) => {
let result =
PublicKeyCredential::from(web_sys::PublicKeyCredential::from(jsval));

let value = to_value(result.clone()).unwrap_throw();
console::log_1(&format!("get assertion: {:#?}", value).into());
let _ = tx.send(Ok(result));
let _ = tx.send(Ok(PublicKeyCredential::from(
web_sys::PublicKeyCredential::from(jsval),
)));
}
Err(e) => {
let _ = tx.send(Err(DeviceError::GetAssertion(format!("{:?}", e))));
Expand Down Expand Up @@ -85,14 +81,9 @@ impl WebauthnBackend for BrowserBackend {

match JsFuture::from(promise).await {
Ok(jsval) => {
let result = RegisterPublicKeyCredential::from(
let _ = tx.send(Ok(RegisterPublicKeyCredential::from(
web_sys::PublicKeyCredential::from(jsval),
);

let value = to_value(result.clone()).unwrap_throw();
console::log_1(&format!("create credential: {:#?}", value).into());

let _ = tx.send(Ok(result));
)));
}
Err(_e) => {
let _ = tx.send(Err(DeviceError::CreateCredential("".to_string())));
Expand Down

0 comments on commit 11a5a90

Please sign in to comment.