fmt: split the new account creation into several sub functions, will be re using a few for the email password reset

This commit is contained in:
silver 2023-06-04 23:42:09 +01:00
parent c11b520c77
commit 57e07d49a7
2 changed files with 109 additions and 84 deletions

View file

@ -12,9 +12,12 @@ use tide::prelude::*;
pub struct AccountsPending {
user: String,
mail: String,
name_first: String,
name_second: String,
cn: String,
sn: String,
auth_code: String,
// action will be what to do with it
action: String,
// will only last for a few hours
expiry: i64,
}
@ -38,8 +41,9 @@ pub async fn db_init(config: &Config) -> Result<Pool<Sqlite>, Error> {
"CREATE TABLE IF NOT EXISTS accounts_pending (
user text primary key,
mail text not null,
name_first text not null,
name_second text not null,
cn text not null,
sn text not null,
action text not null,
auth_code text not null,
expiry integer not null
)",