|
|
@ -28,6 +28,7 @@ pub fn routes() -> Vec<Route> {
|
|
|
|
invite_user,
|
|
|
|
invite_user,
|
|
|
|
delete_user,
|
|
|
|
delete_user,
|
|
|
|
deauth_user,
|
|
|
|
deauth_user,
|
|
|
|
|
|
|
|
remove_2fa,
|
|
|
|
update_revision_users,
|
|
|
|
update_revision_users,
|
|
|
|
post_config,
|
|
|
|
post_config,
|
|
|
|
delete_config,
|
|
|
|
delete_config,
|
|
|
@ -196,6 +197,18 @@ fn deauth_user(uuid: String, _token: AdminToken, conn: DbConn) -> EmptyResult {
|
|
|
|
user.save(&conn)
|
|
|
|
user.save(&conn)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[post("/users/<uuid>/remove-2fa")]
|
|
|
|
|
|
|
|
fn remove_2fa(uuid: String, _token: AdminToken, conn: DbConn) -> EmptyResult {
|
|
|
|
|
|
|
|
let mut user = match User::find_by_uuid(&uuid, &conn) {
|
|
|
|
|
|
|
|
Some(user) => user,
|
|
|
|
|
|
|
|
None => err!("User doesn't exist"),
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TwoFactor::delete_all_by_user(&user.uuid, &conn)?;
|
|
|
|
|
|
|
|
user.totp_recover = None;
|
|
|
|
|
|
|
|
user.save(&conn)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#[post("/users/update_revision")]
|
|
|
|
#[post("/users/update_revision")]
|
|
|
|
fn update_revision_users(_token: AdminToken, conn: DbConn) -> EmptyResult {
|
|
|
|
fn update_revision_users(_token: AdminToken, conn: DbConn) -> EmptyResult {
|
|
|
|
User::update_all_revisions(&conn)
|
|
|
|
User::update_all_revisions(&conn)
|
|
|
|