diff --git a/Cargo.lock b/Cargo.lock index 5f958d44..67669e4b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2505,7 +2505,7 @@ dependencies = [ [[package]] name = "rauth" version = "1.0.0" -source = "git+https://github.com/insertish/rauth?rev=1fe2187ad30231b6ba6432167ba0d929e97ffcc2#1fe2187ad30231b6ba6432167ba0d929e97ffcc2" +source = "git+https://github.com/insertish/rauth?rev=e71d54eba4712b6c6a8a4354ad9fa39677714e1f#e71d54eba4712b6c6a8a4354ad9fa39677714e1f" dependencies = [ "async-std", "async-trait", @@ -2986,15 +2986,23 @@ dependencies = [ [[package]] name = "rocket_rauth" version = "1.0.0" -source = "git+https://github.com/insertish/rauth?rev=1fe2187ad30231b6ba6432167ba0d929e97ffcc2#1fe2187ad30231b6ba6432167ba0d929e97ffcc2" +source = "git+https://github.com/insertish/rauth?rev=e71d54eba4712b6c6a8a4354ad9fa39677714e1f#e71d54eba4712b6c6a8a4354ad9fa39677714e1f" dependencies = [ + "async-std", + "base32", + "chrono", + "iso8601-timestamp", + "mongodb", "okapi", "rauth", + "regex", + "reqwest", "rocket", "rocket_empty", "rocket_okapi", "schemars", "serde", + "serde_json", ] [[package]] diff --git a/crates/delta/Cargo.toml b/crates/delta/Cargo.toml index 22c3fcef..5e7c256c 100644 --- a/crates/delta/Cargo.toml +++ b/crates/delta/Cargo.toml @@ -52,7 +52,7 @@ mobc-redis = { version = "0.7.0", default-features = false, features = ["async-s # web rocket = { version = "0.5.0-rc.2", default-features = false, features = ["json"] } rocket_empty = { git = "https://github.com/insertish/rocket_empty", branch = "master" } -rocket_rauth = { git = "https://github.com/insertish/rauth", rev = "1fe2187ad30231b6ba6432167ba0d929e97ffcc2" } +rocket_rauth = { git = "https://github.com/insertish/rauth", rev = "e71d54eba4712b6c6a8a4354ad9fa39677714e1f" } # spec generation schemars = "0.8.8" diff --git a/crates/quark/Cargo.toml b/crates/quark/Cargo.toml index ab522d11..062b9d14 100644 --- a/crates/quark/Cargo.toml +++ b/crates/quark/Cargo.toml @@ -84,7 +84,7 @@ rocket_empty = { optional = true, git = "https://github.com/insertish/rocket_emp rocket_cors = { optional = true, git = "https://github.com/lawliet89/rocket_cors", rev = "5843861a88958c16bfaa0b40f0d8910772bcd2f6" } # rAuth -rauth = { git = "https://github.com/insertish/rauth", rev = "1fe2187ad30231b6ba6432167ba0d929e97ffcc2", features = [ "async-std-runtime" ] } +rauth = { git = "https://github.com/insertish/rauth", rev = "e71d54eba4712b6c6a8a4354ad9fa39677714e1f", features = [ "async-std-runtime" ] } # Sentry sentry = "0.25.0" diff --git a/crates/quark/assets/templates/deletion.txt b/crates/quark/assets/templates/deletion.txt new file mode 100644 index 00000000..c77a6409 --- /dev/null +++ b/crates/quark/assets/templates/deletion.txt @@ -0,0 +1,5 @@ +You requested to have your account deleted, if you did not perform this action please take measures to secure your account immediately. + +Confirm here: {{url}} + +Sent by Revolt. \ No newline at end of file diff --git a/crates/quark/src/impl/rocket.rs b/crates/quark/src/impl/rocket.rs index a68d011c..f36c8e1a 100644 --- a/crates/quark/src/impl/rocket.rs +++ b/crates/quark/src/impl/rocket.rs @@ -55,16 +55,16 @@ impl<'r> OpenApiFromRequest<'r> for User { _required: bool, ) -> rocket_okapi::Result { let mut requirements = schemars::Map::new(); - requirements.insert("Api Key".to_owned(), vec![]); + requirements.insert("Session Token".to_owned(), vec![]); Ok(RequestHeaderInput::Security( - "Api Key".to_owned(), + "Session Token".to_owned(), SecurityScheme { data: SecuritySchemeData::ApiKey { name: "x-session-token".to_owned(), location: "header".to_owned(), }, - description: Some("Session Token".to_owned()), + description: Some("Used to authenticate as a user.".to_owned()), extensions: schemars::Map::new(), }, requirements, diff --git a/crates/quark/src/util/rauth.rs b/crates/quark/src/util/rauth.rs index 3e3382af..398d4557 100644 --- a/crates/quark/src/util/rauth.rs +++ b/crates/quark/src/util/rauth.rs @@ -34,6 +34,12 @@ pub fn config() -> Config { url: format!("{}/login/reset/", *APP_URL), html: None, }, + deletion: Template { + title: "Confirm account deletion.".into(), + text: include_str!(crate::asset!("templates/deletion.txt")).into(), + url: format!("{}/delete/", *APP_URL), + html: None, + }, welcome: None, }, }