mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 01:27:31 +08:00
refactor(users): Separate signup and signin (#2921)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -7,13 +7,25 @@ pub mod dashboard_metadata;
|
||||
pub mod sample_data;
|
||||
|
||||
#[derive(serde::Deserialize, Debug, Clone, serde::Serialize)]
|
||||
pub struct ConnectAccountRequest {
|
||||
pub struct SignUpWithMerchantIdRequest {
|
||||
pub name: Secret<String>,
|
||||
pub email: pii::Email,
|
||||
pub password: Secret<String>,
|
||||
pub company_name: String,
|
||||
}
|
||||
|
||||
pub type SignUpWithMerchantIdResponse = AuthorizeResponse;
|
||||
|
||||
#[derive(serde::Deserialize, Debug, Clone, serde::Serialize)]
|
||||
pub struct SignUpRequest {
|
||||
pub email: pii::Email,
|
||||
pub password: Secret<String>,
|
||||
}
|
||||
|
||||
pub type SignUpResponse = DashboardEntryResponse;
|
||||
|
||||
#[derive(serde::Serialize, Debug, Clone)]
|
||||
pub struct ConnectAccountResponse {
|
||||
pub struct DashboardEntryResponse {
|
||||
pub token: Secret<String>,
|
||||
pub merchant_id: String,
|
||||
pub name: Secret<String>,
|
||||
@ -25,6 +37,28 @@ pub struct ConnectAccountResponse {
|
||||
pub user_id: String,
|
||||
}
|
||||
|
||||
pub type SignInRequest = SignUpRequest;
|
||||
|
||||
pub type SignInResponse = DashboardEntryResponse;
|
||||
|
||||
#[derive(serde::Deserialize, Debug, Clone, serde::Serialize)]
|
||||
pub struct ConnectAccountRequest {
|
||||
pub email: pii::Email,
|
||||
}
|
||||
|
||||
pub type ConnectAccountResponse = AuthorizeResponse;
|
||||
|
||||
#[derive(serde::Serialize, Debug, Clone)]
|
||||
pub struct AuthorizeResponse {
|
||||
pub is_email_sent: bool,
|
||||
//this field is added for audit/debug reasons
|
||||
#[serde(skip_serializing)]
|
||||
pub user_id: String,
|
||||
//this field is added for audit/debug reasons
|
||||
#[serde(skip_serializing)]
|
||||
pub merchant_id: String,
|
||||
}
|
||||
|
||||
#[derive(serde::Deserialize, Debug, serde::Serialize)]
|
||||
pub struct ChangePasswordRequest {
|
||||
pub new_password: Secret<String>,
|
||||
@ -36,6 +70,8 @@ pub struct SwitchMerchantIdRequest {
|
||||
pub merchant_id: String,
|
||||
}
|
||||
|
||||
pub type SwitchMerchantResponse = DashboardEntryResponse;
|
||||
|
||||
#[derive(serde::Deserialize, Debug, serde::Serialize)]
|
||||
pub struct CreateInternalUserRequest {
|
||||
pub name: Secret<String>,
|
||||
|
||||
Reference in New Issue
Block a user