Skip to content
This repository was archived by the owner on Jul 6, 2024. It is now read-only.

Commit 991b749

Browse files
committed
fix: Handle Accounts with both TOTP and FIDO2 2FA
1 parent 730c96a commit 991b749

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "proton-api-rs"
33
authors = ["Leander Beernaert <[email protected]>"]
4-
version = "0.10.1"
4+
version = "0.10.2"
55
edition = "2021"
66
license = "AGPL-3.0-only"
77
description = "Unofficial implemention of proton REST API in rust"
@@ -48,4 +48,4 @@ required-features = ["http-reqwest"]
4848

4949
[[example]]
5050
name = "user_id_sync"
51-
required-features = ["http-ureq"]
51+
required-features = ["http-ureq"]

src/clientv2/session.rs

+1
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ fn validate_server_proof(
229229
TFAStatus::None => Ok(SessionType::Authenticated(session)),
230230
TFAStatus::Totp => Ok(SessionType::AwaitingTotp(TotpSession(session))),
231231
TFAStatus::FIDO2 => Err(LoginError::Unsupported2FA(TwoFactorAuth::FIDO2)),
232+
TFAStatus::TotpOrFIDO2 => Ok(SessionType::AwaitingTotp(TotpSession(session))),
232233
}
233234
}
234235

src/requests/auth.rs

+1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ pub enum TFAStatus {
104104
None = 0,
105105
Totp = 1,
106106
FIDO2 = 2,
107+
TotpOrFIDO2 = 3,
107108
}
108109

109110
#[doc(hidden)]

0 commit comments

Comments
 (0)