add ratelimits

This commit is contained in:
Zomatree
2021-09-07 15:48:06 +01:00
parent b0d2e99588
commit 2f452b15b1
7 changed files with 190 additions and 112 deletions

View File

@@ -31,11 +31,12 @@ use rauth::{
};
use std::str::FromStr;
use rocket_cors::AllowedOrigins;
use rocket::catchers;
// use rocket::catchers;
use util::variables::{
APP_URL, HCAPTCHA_KEY, INVITE_ONLY, PUBLIC_URL, SMTP_FROM, SMTP_HOST, SMTP_PASSWORD,
SMTP_USERNAME, USE_EMAIL, USE_HCAPTCHA,
};
use crate::util::ratelimit::RatelimitState;
#[async_std::main]
async fn main() {
@@ -146,8 +147,9 @@ Reset your password here: {{url}}",
.mount("/auth", rauth::routes::routes())
.manage(auth)
.manage(cors.clone())
.manage(RatelimitState::new())
.attach(cors)
.register("/", catchers![rocket_governor::rocket_governor_catcher])
// .register("/", catchers![rocket_governor::rocket_governor_catcher])
.launch()
.await
.unwrap();