29 lines
626 B
Rust
29 lines
626 B
Rust
![]() |
pub mod auth;
|
||
|
use axum::{
|
||
|
Router,
|
||
|
routing::{get, post},
|
||
|
};
|
||
|
use serde::Deserialize;
|
||
|
|
||
|
pub fn routes() -> Router {
|
||
|
Router::new()
|
||
|
// global
|
||
|
.route("/auth/register", post(auth::register_request))
|
||
|
.route("/auth/login", post(auth::login_request))
|
||
|
// profile
|
||
|
.route(
|
||
|
"/auth/profile/{id}/avatar",
|
||
|
get(auth::images::avatar_request),
|
||
|
)
|
||
|
.route(
|
||
|
"/auth/profile/{id}/banner",
|
||
|
get(auth::images::banner_request),
|
||
|
)
|
||
|
}
|
||
|
|
||
|
#[derive(Deserialize)]
|
||
|
pub struct AuthProps {
|
||
|
pub username: String,
|
||
|
pub password: String,
|
||
|
}
|