@smbcloud / cli / commits / 245fa58

Handle additional account error codes in login process

keypair34 committed May 10, 2026 at 01:36 UTC 245fa587caa57a5e0e87634a5c2c626e86b361d3
2 files changed +14 -2
crates/cli/src/account/login/process.rs
+10 -2
@@ -23,8 +23,9 @@ use {
23 smbcloud_model::{
24 account::{
25 ErrorCode::{
26 - self as AccountErrorCode, EmailNotFound, EmailUnverified, GithubNotLinked,
27 - PasswordNotSet,
26 + self as AccountErrorCode, EmailAlreadyExist, EmailConfirmationFailed,
27 + EmailNotFound, EmailUnverified, GithubNotLinked, HostedMailAccountUnverified,
28 + InvalidPassword, PasswordNotSet,
29 },
30 GithubInfo, SmbAuthorization, User,
31 },
@@ -100,6 +101,13 @@ async fn process_authorization(env: Environment, auth: SmbAuthorization) -> Resu
101 return Err(error);
102 }
103 GithubNotLinked => return connect_github_account(env, auth).await,
104 + EmailConfirmationFailed
105 + | EmailAlreadyExist
106 + | InvalidPassword
107 + | HostedMailAccountUnverified => {
108 + let error = anyhow!(error_code.to_string());
109 + return Err(error);
110 + }
111 }
112 }
113
crates/smbcloud-auth-sdk-py/src/lib.rs
+4
@@ -91,8 +91,12 @@ fn account_error_name(code: AccountErrorCode) -> &'static str {
91 match code {
92 AccountErrorCode::EmailNotFound => "email_not_found",
93 AccountErrorCode::EmailUnverified => "email_unverified",
94 + AccountErrorCode::EmailConfirmationFailed => "email_confirmation_failed",
95 AccountErrorCode::PasswordNotSet => "password_not_set",
96 AccountErrorCode::GithubNotLinked => "github_not_linked",
97 + AccountErrorCode::EmailAlreadyExist => "email_already_exist",
98 + AccountErrorCode::InvalidPassword => "invalid_password",
99 + AccountErrorCode::HostedMailAccountUnverified => "hosted_mail_account_unverified",
100 }
101 }
102