@@ -2,7 +2,7 @@ use std::env::args;
22use std:: error:: Error ;
33use steam_vent:: auth:: {
44 AuthConfirmationHandler , ConsoleAuthConfirmationHandler , DeviceConfirmationHandler ,
5- FileGuardDataStore ,
5+ FileGuardDataStore , SharedSecretAuthConfirmationHandler ,
66} ;
77use steam_vent:: proto:: steammessages_player_steamclient:: CPlayer_GetOwnedGames_Request ;
88use steam_vent:: { Connection , ConnectionSender , ServerList } ;
@@ -14,16 +14,32 @@ async fn main() -> Result<(), Box<dyn Error>> {
1414 let mut args = args ( ) . skip ( 1 ) ;
1515 let account = args. next ( ) . expect ( "no account" ) ;
1616 let password = args. next ( ) . expect ( "no password" ) ;
17+ // base64 encoded
18+ let guard_secret = args. next ( ) ;
1719
1820 let server_list = ServerList :: discover ( ) . await ?;
19- let connection = Connection :: login (
20- & server_list,
21- & account,
22- & password,
23- FileGuardDataStore :: user_cache ( ) ,
24- ConsoleAuthConfirmationHandler :: default ( ) . or ( DeviceConfirmationHandler ) ,
25- )
26- . await ?;
21+ let connection = match guard_secret {
22+ Some ( secret) => {
23+ Connection :: login (
24+ & server_list,
25+ & account,
26+ & password,
27+ FileGuardDataStore :: user_cache ( ) ,
28+ SharedSecretAuthConfirmationHandler :: new ( & secret) ,
29+ )
30+ . await ?
31+ }
32+ None => {
33+ Connection :: login (
34+ & server_list,
35+ & account,
36+ & password,
37+ FileGuardDataStore :: user_cache ( ) ,
38+ ConsoleAuthConfirmationHandler :: default ( ) . or ( DeviceConfirmationHandler ) ,
39+ )
40+ . await ?
41+ }
42+ } ;
2743
2844 println ! ( "requesting games" ) ;
2945
0 commit comments