diff options
| author | Ellie Huxtable <ellie@atuin.sh> | 2026-01-27 13:56:18 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-27 13:56:18 -0800 |
| commit | e2b421c88479857831e938acb311aef5127f38b4 (patch) | |
| tree | 0ff160c378f1c151ecb30fa0329aafcee72b8d9d /crates/atuin-client/src/api_client.rs | |
| parent | chore(deps): cleanup of dep versions (#3106) (diff) | |
| download | atuin-e2b421c88479857831e938acb311aef5127f38b4.zip | |
feat: remove user verification functionality (#3108)
<!-- Thank you for making a PR! Bug fixes are always welcome, but if
you're adding a new feature or changing an existing one, we'd really
appreciate if you open an issue, post on the forum, or drop in on
Discord -->
## Checks
- [ ] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [ ] I have checked that there are no existing pull requests for the
same thing
---------
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Diffstat (limited to 'crates/atuin-client/src/api_client.rs')
| -rw-r--r-- | crates/atuin-client/src/api_client.rs | 36 |
1 files changed, 2 insertions, 34 deletions
diff --git a/crates/atuin-client/src/api_client.rs b/crates/atuin-client/src/api_client.rs index 41f824a9..86452d50 100644 --- a/crates/atuin-client/src/api_client.rs +++ b/crates/atuin-client/src/api_client.rs @@ -15,9 +15,8 @@ use atuin_common::{ use atuin_common::{ api::{ AddHistoryRequest, ChangePasswordRequest, CountResponse, DeleteHistoryRequest, - ErrorResponse, LoginRequest, LoginResponse, MeResponse, RegisterResponse, - SendVerificationResponse, StatusResponse, SyncHistoryResponse, VerificationTokenRequest, - VerificationTokenResponse, + ErrorResponse, LoginRequest, LoginResponse, MeResponse, RegisterResponse, StatusResponse, + SyncHistoryResponse, }, record::RecordStatus, }; @@ -427,35 +426,4 @@ impl<'a> Client<'a> { bail!("Unknown error"); } } - - // Either request a verification email if token is null, or validate a token - pub async fn verify(&self, token: Option<String>) -> Result<(bool, bool)> { - // could dedupe this a bit, but it's simple at the moment - let (email_sent, verified) = if let Some(token) = token { - let url = make_url(self.sync_addr, "/api/v0/account/verify")?; - let url = Url::parse(url.as_str())?; - - let resp = self - .client - .post(url) - .json(&VerificationTokenRequest { token }) - .send() - .await?; - let resp = handle_resp_error(resp).await?; - let resp = resp.json::<VerificationTokenResponse>().await?; - - (false, resp.verified) - } else { - let url = make_url(self.sync_addr, "/api/v0/account/send-verification")?; - let url = Url::parse(url.as_str())?; - - let resp = self.client.post(url).send().await?; - let resp = handle_resp_error(resp).await?; - let resp = resp.json::<SendVerificationResponse>().await?; - - (resp.email_sent, resp.verified) - }; - - Ok((email_sent, verified)) - } } |
