✨ mqtt connections
almost working, need encryption
This commit is contained in:
parent
20ab0153d1
commit
125d50530d
15 changed files with 1259 additions and 42 deletions
|
@ -1,4 +1,5 @@
|
|||
use crate::api;
|
||||
use crate::api::JoinResponse;
|
||||
use crate::server_core::model::Machine;
|
||||
use axum::Json;
|
||||
use axum::http::StatusCode;
|
||||
|
@ -44,5 +45,14 @@ pub async fn join_device(
|
|||
|
||||
save!(machine);
|
||||
|
||||
(StatusCode::OK, Json(json!({"ok": new_token})))
|
||||
let i = crate::IDENTITY.get().unwrap();
|
||||
|
||||
(
|
||||
StatusCode::OK,
|
||||
Json(json!(JoinResponse {
|
||||
token: new_token,
|
||||
identity: i.public(),
|
||||
mqtt: crate::CONFIG.get().unwrap().mqtt.clone()
|
||||
})),
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue