Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/routes/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ async fn auth_me(
/// Providing the token either by including it in the
/// request header or sending the cookie is required
/// to perform any further operations.
/// By default, the only existing account is the infrastructure admin
/// with username and password "admin".
#[utoipa::path(post, path = "/auth/login", request_body=LoginRequest,
responses
(
Expand All @@ -78,7 +80,7 @@ async fn auth_me(
)
)
]
pub async fn auth_login(
async fn auth_login(
cookies: Cookies,
State(state): State<AppState>,
Json(body): Json<LoginRequest>,
Expand Down
2 changes: 2 additions & 0 deletions src/routes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ mod swagger;
mod team_routes;
mod teapot;
mod tournament_routes;
mod user_routes;
mod version;

pub fn routes() -> Router<AppState> {
Expand All @@ -29,6 +30,7 @@ pub fn routes() -> Router<AppState> {
.merge(attendee_routes::route())
.merge(motion_routes::route())
.merge(debate_routes::route())
.merge(user_routes::route())
.merge(location_routes::route())
.merge(room_routes::route())
}
15 changes: 15 additions & 0 deletions src/routes/swagger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use utoipa::OpenApi;
use utoipa_swagger_ui::SwaggerUi;

use crate::routes::auth;
use crate::routes::user_routes;
use crate::setup::AppState;

use crate::routes::attendee_routes;
Expand All @@ -20,7 +21,9 @@ use crate::tournament::motion;
use crate::tournament::room;
use crate::tournament::team;
use crate::users::permissions;
use crate::users::photourl;
use crate::users::roles;
use crate::users::UserPatch;

use super::health_check;
use super::teapot;
Expand Down Expand Up @@ -66,6 +69,7 @@ pub fn route() -> Router<AppState> {
attendee_routes::delete_attendee_by_id,
auth::auth_login,
auth::auth_me,
auth::auth_clear,
location_routes::create_location,
location_routes::get_locations,
location_routes::get_location_by_id,
Expand All @@ -76,6 +80,12 @@ pub fn route() -> Router<AppState> {
room_routes::get_room_by_id,
room_routes::patch_room_by_id,
room_routes::delete_room_by_id,
user_routes::get_users,
user_routes::create_user,
user_routes::get_user_by_id,
user_routes::patch_user_by_id,
user_routes::delete_user_by_id,
user_routes::change_user_password,
),
components(schemas(
version::VersionDetails,
Expand All @@ -98,6 +108,11 @@ pub fn route() -> Router<AppState> {
location::LocationPatch,
room::Room,
room::RoomPatch,
user_routes::UserWithPassword,
user_routes::UserPasswordPatch,
crate::users::UserPatch,
crate::users::User,
photourl::PhotoUrl
))
)]

Expand Down
Loading