Add 2fa compliance (#12)

* Add 2fa

* Apply Changes
This commit is contained in:
C0D3 M4513R
2024-07-21 03:01:06 +02:00
committed by GitHub
parent 4294b4bff4
commit b1f02f4785
6 changed files with 35 additions and 4 deletions

View File

@ -5,8 +5,10 @@ async fn main() {
let mut config = apis::configuration::Configuration::default();
config.basic_auth = Some((String::from("username"), Some(String::from("password"))));
let me = apis::authentication_api::get_current_user(&config).await.unwrap();
println!("Username: {}", me.username.unwrap());
match apis::authentication_api::get_current_user(&config).await.unwrap() {
vrchatapi::models::EitherUserOrTwoFactor::CurrentUser(me) => println!("Username: {}", me.username.unwrap()),
vrchatapi::models::EitherUserOrTwoFactor::RequiresTwoFactorAuth(requires_auth) => println!("The Username requires Auth: {:?}", requires_auth.requires_two_factor_auth)
}
let online = apis::system_api::get_current_online_users(&config).await.unwrap();
println!("Current Online Users: {}", online);