feature/sdk-npm
claude/smbcloud-github-app-k9641p
development
feature/apps
feature/build-release
feature/ci-docs
feature/ci-ruby-gems
feature/cicd
feature/completion
feature/dist-nuget
feature/fix-ci-sdk-pypi-rubygem
feature/fix-clippy-on-stable-channel
feature/fix-deployment-script
feature/github-email
feature/gresiq-v1
feature/project-new-structure
feature/rsync-deploy
feature/ruby-runner
feature/sdk-npm
feature/sdk-workflows
feature/smbcloud-cli-release-npm
feature/smbcloud-deploy
feature/wasm
main
release/v0.7.4
| 1 | use { |
| 2 | reqwest::Client, |
| 3 | smbcloud_model::{ |
| 4 | error_codes::ErrorResponse, |
| 5 | signup::{SignupEmailParams, SignupResult, SignupUserEmail}, |
| 6 | }, |
| 7 | smbcloud_network::{environment::Environment, network::request}, |
| 8 | smbcloud_networking::{constants::PATH_USERS, smb_base_url_builder, smb_client::SmbClient}, |
| 9 | }; |
| 10 | |
| 11 | pub async fn signup( |
| 12 | env: Environment, |
| 13 | client: (&SmbClient, &str), |
| 14 | email: String, |
| 15 | password: String, |
| 16 | ) -> Result<SignupResult, ErrorResponse> { |
| 17 | let params = SignupEmailParams { |
| 18 | user: SignupUserEmail { email, password }, |
| 19 | }; |
| 20 | let builder = Client::new() |
| 21 | .post(build_smb_signup_url(env, client)) |
| 22 | .json(¶ms) |
| 23 | .header("User-agent", client.0.id()); |
| 24 | request(builder).await |
| 25 | } |
| 26 | |
| 27 | fn build_smb_signup_url(env: Environment, client: (&SmbClient, &str)) -> String { |
| 28 | let mut url_builder = smb_base_url_builder(env, client); |
| 29 | url_builder.add_route(PATH_USERS); |
| 30 | url_builder.build() |
| 31 | } |