Moved login and register to users
This commit is contained in:
parent
7669a02a95
commit
ea5c65b6e5
@ -1,2 +0,0 @@
|
|||||||
pub mod auth_post;
|
|
||||||
pub mod register;
|
|
@ -1,4 +1,3 @@
|
|||||||
pub mod authorization;
|
|
||||||
pub mod file;
|
pub mod file;
|
||||||
pub mod folder;
|
pub mod folder;
|
||||||
pub mod permissions;
|
pub mod permissions;
|
||||||
|
@ -11,7 +11,7 @@ pub struct Params {
|
|||||||
password: String,
|
password: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn post(
|
pub async fn login(
|
||||||
State(pool): State<Pool>,
|
State(pool): State<Pool>,
|
||||||
Form(payload): Form<Params>,
|
Form(payload): Form<Params>,
|
||||||
) -> Result<Json<Token>, Error> {
|
) -> Result<Json<Token>, Error> {
|
@ -1,4 +1,6 @@
|
|||||||
pub mod delete;
|
pub mod delete;
|
||||||
pub mod get;
|
pub mod get;
|
||||||
|
pub mod login;
|
||||||
pub mod put;
|
pub mod put;
|
||||||
|
pub mod register;
|
||||||
pub mod search;
|
pub mod search;
|
||||||
|
@ -74,7 +74,7 @@ async fn main() -> anyhow::Result<()> {
|
|||||||
fn app(state: AppState) -> Router {
|
fn app(state: AppState) -> Router {
|
||||||
use axum::{http::header, routing::get};
|
use axum::{http::header, routing::get};
|
||||||
use endpoints::{
|
use endpoints::{
|
||||||
authorization, file, folder,
|
file, folder,
|
||||||
permissions::{self, get_top_level::get_top_level},
|
permissions::{self, get_top_level::get_top_level},
|
||||||
users,
|
users,
|
||||||
};
|
};
|
||||||
@ -121,8 +121,8 @@ fn app(state: AppState) -> Router {
|
|||||||
)
|
)
|
||||||
.route("/users/current", get(users::get::current))
|
.route("/users/current", get(users::get::current))
|
||||||
.route("/users/search", get(users::search::search))
|
.route("/users/search", get(users::search::search))
|
||||||
.route("/register", post(authorization::register::register))
|
.route("/users/register", post(users::register::register))
|
||||||
.route("/authorize", post(authorization::auth_post::post))
|
.route("/users/authorize", post(users::login::login))
|
||||||
.layer(middleware)
|
.layer(middleware)
|
||||||
.with_state(state)
|
.with_state(state)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user