Do not prefix Steam TOTP account name with Steam

This commit is contained in:
timvisee 2023-01-05 17:14:06 +01:00
parent 005ae37f70
commit 5e61d15432
No known key found for this signature in database
GPG Key ID: B8DB720BC383E172
1 changed files with 2 additions and 4 deletions

View File

@ -14,7 +14,7 @@ impl TOTP {
/// let secret = Secret::Encoded("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".to_string()); /// let secret = Secret::Encoded("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".to_string());
/// let totp = TOTP::new_steam(secret.to_bytes().unwrap(), Some("username".to_string())); /// let totp = TOTP::new_steam(secret.to_bytes().unwrap(), Some("username".to_string()));
/// ``` /// ```
pub fn new_steam(secret: Vec<u8>, account_name: Option<String>) -> TOTP { pub fn new_steam(secret: Vec<u8>, account_name: String) -> TOTP {
Self::new_unchecked( Self::new_unchecked(
Algorithm::Steam, Algorithm::Steam,
5, 5,
@ -22,9 +22,7 @@ impl TOTP {
30, 30,
secret, secret,
Some("Steam".into()), Some("Steam".into()),
account_name account_name,
.map(|n| format!("Steam:{}", n))
.unwrap_or_else(|| "".into()),
) )
} }