Login endpoint is doing something
All checks were successful
Rust Build / Check (pull_request) Successful in 44s
Rust Build / Test Suite (pull_request) Successful in 51s
Rust Build / Rustfmt (pull_request) Successful in 26s
Rust Build / Clippy (pull_request) Successful in 43s
Rust Build / build (pull_request) Successful in 1m7s
All checks were successful
Rust Build / Check (pull_request) Successful in 44s
Rust Build / Test Suite (pull_request) Successful in 51s
Rust Build / Rustfmt (pull_request) Successful in 26s
Rust Build / Clippy (pull_request) Successful in 43s
Rust Build / build (pull_request) Successful in 1m7s
This commit is contained in:
@@ -14,6 +14,7 @@ pub mod response {
|
|||||||
#[derive(Default, Deserialize, Serialize)]
|
#[derive(Default, Deserialize, Serialize)]
|
||||||
pub struct Response {
|
pub struct Response {
|
||||||
pub message: String,
|
pub message: String,
|
||||||
|
pub data: Vec<icarus_models::login_result::LoginResult>,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,6 +67,13 @@ pub mod endpoint {
|
|||||||
StatusCode::OK,
|
StatusCode::OK,
|
||||||
Json(response::Response {
|
Json(response::Response {
|
||||||
message: String::from("Not implemented"),
|
message: String::from("Not implemented"),
|
||||||
|
data: vec![icarus_models::login_result::LoginResult {
|
||||||
|
id: user.id,
|
||||||
|
username: user.username,
|
||||||
|
token: token_literal,
|
||||||
|
token_type: String::from("JWT"),
|
||||||
|
expiration: -1,
|
||||||
|
}],
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
@@ -73,6 +81,7 @@ pub mod endpoint {
|
|||||||
StatusCode::BAD_REQUEST,
|
StatusCode::BAD_REQUEST,
|
||||||
Json(response::Response {
|
Json(response::Response {
|
||||||
message: String::from("Not implemented"),
|
message: String::from("Not implemented"),
|
||||||
|
data: vec![icarus_models::login_result::LoginResult::default()],
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@@ -45,7 +45,7 @@ pub mod db {
|
|||||||
sqlx::migrate!("./migrations")
|
sqlx::migrate!("./migrations")
|
||||||
.run(pool)
|
.run(pool)
|
||||||
.await
|
.await
|
||||||
.expect("Failed to run migrations on testcontainer DB");
|
.expect("Failed to run migrations");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,6 +31,10 @@ mod init {
|
|||||||
callers::endpoints::REGISTER,
|
callers::endpoints::REGISTER,
|
||||||
post(callers::register::register_user),
|
post(callers::register::register_user),
|
||||||
)
|
)
|
||||||
|
.route(
|
||||||
|
callers::endpoints::LOGIN,
|
||||||
|
post(callers::login::endpoint::login),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn app() -> Router {
|
pub async fn app() -> Router {
|
||||||
|
Reference in New Issue
Block a user