diff --git a/crates/ezidam/src/routes/oauth.rs b/crates/ezidam/src/routes/oauth.rs index 4d4f8f9..991c038 100644 --- a/crates/ezidam/src/routes/oauth.rs +++ b/crates/ezidam/src/routes/oauth.rs @@ -1,13 +1,17 @@ -use super::prelude::*; -use apps::App; -use authorization_codes::AuthorizationCodes; -use hash::SecretString; -use rocket::{get, post}; -use settings::Settings; -use users::User; +use authorize::*; +use redirect::*; +use rocket::{routes, Route}; + +mod authorize; +mod redirect; pub fn routes() -> Vec { - routes![authorize_page, authorize, authorize_ezidam] + routes![ + authorize_page, + authorize_form, + authorize_ezidam, + redirect_page + ] } pub mod content { @@ -21,165 +25,3 @@ pub mod content { pub business_name: String, } } - -// TODO: When already signed in, pass Result in existing routes directly - -#[get("/oauth/authorize?", rank = 2)] -async fn authorize_page( - mut db: Connection, - flash: Option>, - auth_request: AuthenticationRequest<'_>, -) -> Result