Ignore Rocket.toml

This commit is contained in:
Paul Makles
2020-06-14 09:54:01 +01:00
parent 8043690d38
commit 50ef5c43c7
6 changed files with 390 additions and 412 deletions

View File

@@ -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!" }),
)
}
}

View File

@@ -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)

View File

@@ -6,6 +6,6 @@ use bson::doc;
#[get("/")]
pub fn root() -> Response {
Response::Success(json!({
"revolt": "0.1.0"
"revolt": "0.2.0"
}))
}