Formatting...

This commit is contained in:
2021-08-12 15:48:02 +02:00
committed by dietrich
parent 26142084f6
commit 50da81889e
8 changed files with 44 additions and 49 deletions
+1 -4
View File
@@ -378,10 +378,7 @@ pub async fn webservice(
"/get_logged_user/",
web::post().to(views::get_logged_user_json),
)
.route(
"/login_user/",
web::post().to(views::process_login_json),
),
.route("/login_user/", web::post().to(views::process_login_json)),
)
// login to the admin area
.route("/login/", web::get().to(views::login))
+1 -3
View File
@@ -174,9 +174,7 @@ pub async fn get_logged_user_json(
) -> Result<HttpResponse, ServerError> {
let user = authenticate(&id, &config).await?;
match user {
Role::NotAuthenticated | Role::Disabled => {
Ok(HttpResponse::Unauthorized().finish())
}
Role::NotAuthenticated | Role::Disabled => Ok(HttpResponse::Unauthorized().finish()),
Role::Regular { user } | Role::Admin { user } => Ok(HttpResponse::Ok().json2(&user)),
}
}