backend signup
This commit is contained in:
@@ -8,6 +8,7 @@ use uuid::Uuid;
|
||||
paths(
|
||||
doc::health_check,
|
||||
doc::login,
|
||||
doc::signup,
|
||||
doc::refresh,
|
||||
doc::logout,
|
||||
doc::me,
|
||||
@@ -53,6 +54,7 @@ use uuid::Uuid;
|
||||
components(
|
||||
schemas(
|
||||
schemas::LoginRequest,
|
||||
schemas::SignupRequest,
|
||||
schemas::AccessTokenResponse,
|
||||
schemas::TenantSnippet,
|
||||
schemas::TenantSelectionResponse,
|
||||
@@ -151,6 +153,19 @@ mod doc {
|
||||
)]
|
||||
pub(super) fn login() {}
|
||||
|
||||
#[utoipa::path(
|
||||
post,
|
||||
path = "/api/auth/signup",
|
||||
request_body = SignupRequest,
|
||||
responses(
|
||||
(status = 200, description = "Signup succeeded", body = LoginResponseVariants),
|
||||
(status = 400, description = "Invalid signup request"),
|
||||
(status = 409, description = "Username already exists")
|
||||
),
|
||||
tag = "Auth"
|
||||
)]
|
||||
pub(super) fn signup() {}
|
||||
|
||||
#[utoipa::path(
|
||||
post,
|
||||
path = "/api/auth/refresh",
|
||||
@@ -597,6 +612,12 @@ pub mod schemas {
|
||||
pub preferred_tenant_slug: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, ToSchema)]
|
||||
pub struct SignupRequest {
|
||||
pub username: String,
|
||||
pub password: String,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, ToSchema)]
|
||||
pub struct AccessTokenResponse {
|
||||
pub access_token: String,
|
||||
|
||||
Reference in New Issue
Block a user