Login endpoint #20

Merged
phoenix merged 24 commits from login_endpoint into devel 2025-04-07 01:22:59 +00:00
2 changed files with 43 additions and 0 deletions
Showing only changes of commit 84a9bc4d21 - Show all commits

41
src/callers/login.rs Normal file
View File

@@ -0,0 +1,41 @@
pub mod request {
use serde::{Deserialize, Serialize};
#[derive(Default, Deserialize, Serialize)]
pub struct Request {
}
}
pub mod response {
use serde::{Deserialize, Serialize};
#[derive(Default, Deserialize, Serialize)]
pub struct Response {
pub message: String,
}
}
pub mod endpoint {
use axum::{Json, http::StatusCode};
use crate::hashing;
use crate::repo;
use crate::token_stuff;
use super::request;
use super::response;
pub async fn login(
axum::Extension(pool): axum::Extension<sqlx::PgPool>,
Json(payload): Json<request::Request>,
) -> (StatusCode, Json<response::Response>) {
let mut usr = icarus_models::user::User::default();
(
StatusCode::OK,
Json(response::Response {
message: String::from("Not implemented"),
}),
)
}
}

View File

@@ -1,8 +1,10 @@
pub mod common;
pub mod login;
pub mod register;
pub mod endpoints {
pub const ROOT: &str = "/";
pub const REGISTER: &str = "/api/v2/register";
pub const DBTEST: &str = "/api/v2/test/db";
pub const LOGIN: &str = "/api/v2/login";
}