Update registration code.
This commit is contained in:
parent
888402cff2
commit
c0df79f056
1
server/src/config.rs
Normal file
1
server/src/config.rs
Normal file
@ -0,0 +1 @@
|
||||
pub const REGISTER_CODE :&str = "mountain";
|
@ -2,6 +2,7 @@ use std::net::SocketAddr;
|
||||
|
||||
use bus::Bus;
|
||||
|
||||
mod config;
|
||||
mod util;
|
||||
mod app;
|
||||
mod system;
|
||||
|
@ -85,7 +85,7 @@ pub async fn thread_system(mut app:App, bus:Bus<protocol::QRPacket>)
|
||||
println!("Request: Register");
|
||||
|
||||
let mut is_valid = true;
|
||||
if request.code != "abc".as_bytes() { response.status = STATUS_BAD_CODE; is_valid = false; }
|
||||
if request.code != crate::config::REGISTER_CODE.as_bytes() { response.status = STATUS_BAD_CODE; is_valid = false; }
|
||||
if is_valid && request.handle.len() == 0 { response.status = STATUS_BAD_HANDLE; is_valid = false; }
|
||||
if is_valid && request.secret.len() == 0 { response.status = STATUS_BAD_SECRET; is_valid = false; }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user