Add default clients #105
@ -234,14 +234,16 @@ pub async fn users_route(
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn create_user(admin: CurrentUser, clients: web::Data<ClientManager>) -> impl Responder {
|
pub async fn create_user(admin: CurrentUser, clients: web::Data<ClientManager>) -> impl Responder {
|
||||||
let mut user = User::default();
|
let user = User {
|
||||||
user.authorized_clients = Some(
|
authorized_clients: Some(
|
||||||
clients
|
clients
|
||||||
.get_default_clients()
|
.get_default_clients()
|
||||||
.iter()
|
.iter()
|
||||||
.map(|u| u.id.clone())
|
.map(|u| u.id.clone())
|
||||||
.collect(),
|
.collect(),
|
||||||
);
|
),
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
|
|
||||||
HttpResponse::Ok().body(
|
HttpResponse::Ok().body(
|
||||||
EditUserTemplate {
|
EditUserTemplate {
|
||||||
|
Loading…
Reference in New Issue
Block a user