forked from jmug/stoatchat
Ignore Rocket.toml
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
Rocket.toml
|
||||
/target
|
||||
**/*.rs.bk
|
||||
.env
|
||||
|
||||
783
Cargo.lock
generated
783
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,7 +0,0 @@
|
||||
[development]
|
||||
address = "192.168.0.10"
|
||||
port = 5500
|
||||
|
||||
[production]
|
||||
address = "192.168.0.10"
|
||||
port = 3000
|
||||
@@ -78,7 +78,6 @@ pub fn create(info: Json<Create>) -> Response {
|
||||
let sent = email::send_verification_email(info.email.clone(), code);
|
||||
|
||||
Response::Success(json!({
|
||||
"success": true,
|
||||
"email_sent": sent,
|
||||
}))
|
||||
}
|
||||
@@ -200,13 +199,13 @@ pub fn resend_email(info: Json<Resend>) -> Response {
|
||||
match email::send_verification_email(info.email.to_string(), code) {
|
||||
true => Response::Result(super::Status::Ok),
|
||||
false => Response::InternalServerError(
|
||||
json!({ "success": false, "error": "Failed to send email! Likely an issue with the backend API." }),
|
||||
json!({ "error": "Failed to send email! Likely an issue with the backend API." }),
|
||||
),
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Response::NotFound(
|
||||
json!({ "success": false, "error": "Email not found or pending verification!" }),
|
||||
json!({ "error": "Email not found or pending verification!" }),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -531,6 +531,10 @@ pub fn send_message(
|
||||
let content: String = message.content.chars().take(2000).collect();
|
||||
let nonce: String = message.nonce.chars().take(32).collect();
|
||||
|
||||
if content.len() == 0 {
|
||||
return Some(Response::NotAcceptable(json!({ "error": "No message content!" })));
|
||||
}
|
||||
|
||||
let col = database::get_collection("messages");
|
||||
if col
|
||||
.find_one(doc! { "nonce": nonce.clone() }, None)
|
||||
|
||||
@@ -6,6 +6,6 @@ use bson::doc;
|
||||
#[get("/")]
|
||||
pub fn root() -> Response {
|
||||
Response::Success(json!({
|
||||
"revolt": "0.1.0"
|
||||
"revolt": "0.2.0"
|
||||
}))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user