#11 signup email #36
2 changed files with 186 additions and 178 deletions
|
@ -1,6 +1,9 @@
|
|||
use skynet_ldap_backend::{
|
||||
db_init, get_config,
|
||||
methods::{account_new::post_new_account, account_update::post_update_ldap},
|
||||
methods::{
|
||||
account_new::post::{account, email},
|
||||
account_update::post_update_ldap,
|
||||
},
|
||||
State,
|
||||
};
|
||||
|
||||
|
@ -21,7 +24,8 @@ async fn main() -> tide::Result<()> {
|
|||
let mut app = tide::with_state(state);
|
||||
|
||||
app.at("/ldap/update").post(post_update_ldap);
|
||||
app.at("/ldap/new").post(post_new_account);
|
||||
app.at("/ldap/new/email").post(email::submit);
|
||||
app.at("/ldap/new/account").post(account::submit);
|
||||
|
||||
app.listen(host_port).await?;
|
||||
Ok(())
|
||||
|
|
|
@ -232,7 +232,9 @@ pub mod post {
|
|||
.await
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub mod account {
|
||||
use super::*;
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
struct LdapNewUser {
|
||||
|
@ -244,7 +246,7 @@ struct LdapNewUser {
|
|||
/// Handles initial detail entering page
|
||||
/// Verify users have access to said email
|
||||
/// Get users to set username and password.
|
||||
pub async fn post_new_account(mut req: Request<State>) -> tide::Result {
|
||||
pub async fn submit(mut req: Request<State>) -> tide::Result {
|
||||
let LdapNewUser {
|
||||
auth,
|
||||
user,
|
||||
|
@ -452,3 +454,5 @@ async fn account_verification_clear_pending(db: &Pool<Sqlite>, auth_code: &str)
|
|||
.fetch_all(db)
|
||||
.await
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue