diff --git a/DEV.md b/DEV.md index 352bef5..7ca596f 100644 --- a/DEV.md +++ b/DEV.md @@ -6,7 +6,7 @@ On OpenBSD, for LLVM you need to choose llvm-17. -Until this [PR](https://github.com/rustwasm/wasm-pack/pull/1271) is accepted, will have to install wasm-pack this way: +On all platforms, we have to install wasm-pack this way: ``` cargo install wasm-pack --git https://git.nextgraph.org/NextGraph/wasm-pack.git --branch master diff --git a/engine/broker/auth/src/App.svelte b/engine/broker/auth/src/App.svelte index 244c639..d032906 100644 --- a/engine/broker/auth/src/App.svelte +++ b/engine/broker/auth/src/App.svelte @@ -89,9 +89,10 @@ // let walls = await ng.get_wallets(); // wallets.set(walls); // }; + const redirect_server = import.meta.env.NG_REDIR_SERVER || "nextgraph.net"; const iframe_config = import.meta.env.DEV ? {src:"http://localhost:14404/?o=", origin: "http://localhost:14404"} : import.meta.env.NG_DEV ? {src:"http://localhost:1421/auth.html?o=", origin: "http://localhost:1421"} : - {src:"https://nextgraph.net/auth/?o=", origin: "https://nextgraph.net"} ; + {src:`https://${redirect_server}/auth/?o=`, origin: `https://${redirect_server}`} ; // to test ngnet //const iframe_config = {src:"http://127.0.0.1:3033/auth/?o=", origin: "http://127.0.0.1:3033"}; diff --git a/engine/broker/src/server_ws.rs b/engine/broker/src/server_ws.rs index 2707b16..4d8f3ca 100644 --- a/engine/broker/src/server_ws.rs +++ b/engine/broker/src/server_ws.rs @@ -277,19 +277,19 @@ fn upgrade_ws_or_serve_app( // if referer.is_none() || referer.unwrap().to_str().is_err() || referer.unwrap().to_str().unwrap() != "https://nextgraph.net/" { // return Err(make_error(StatusCode::FORBIDDEN)); // } - let webapp_origin = match uri.query() { - Some(query) => { - if query.starts_with("o=") { - match decode(&query.chars().skip(2).collect::()) { - Err(_) => return Err(make_error(StatusCode::BAD_REQUEST)), - Ok(cow) => cow.into_owned(), - } - } else { - return Err(make_error(StatusCode::BAD_REQUEST)); - } - } - None => return Err(make_error(StatusCode::BAD_REQUEST)), - }; + // let webapp_origin = match uri.query() { + // Some(query) => { + // if query.starts_with("o=") { + // match decode(&query.chars().skip(2).collect::()) { + // Err(_) => return Err(make_error(StatusCode::BAD_REQUEST)), + // Ok(cow) => cow.into_owned(), + // } + // } else { + // return Err(make_error(StatusCode::BAD_REQUEST)); + // } + // } + // None => return Err(make_error(StatusCode::BAD_REQUEST)), + // }; let sha_file = AppAuth::get("index.sha256").unwrap(); let sha = format!( "\"{}\"", diff --git a/infra/ngaccount/README.md b/infra/ngaccount/README.md index dc66aa0..3eb561e 100644 --- a/infra/ngaccount/README.md +++ b/infra/ngaccount/README.md @@ -7,7 +7,7 @@ This server is used internally by NextGraph to handle the creation of accounts a ``` cd web npm install -g pnpm -pnpm --ignore-workspace install +pnpm install ``` ## Dev @@ -28,7 +28,6 @@ export NG_ACCOUNT_SERVER=127.0.0.1,14400,[YOUR_NGD_PEER_ID] export RUST_LOG=debug ``` - ```bash cd web pnpm run dev --host diff --git a/infra/ngaccount/web/index.html b/infra/ngaccount/web/index.html index 46cadf2..e436f1a 100644 --- a/infra/ngaccount/web/index.html +++ b/infra/ngaccount/web/index.html @@ -58,7 +58,7 @@ NextGraph