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