@@ -59,7 +59,9 @@ impl From<Login5Error> for Error {
5959
6060impl Login5Manager {
6161 async fn request ( & self , message : & LoginRequest ) -> Result < Bytes , Error > {
62+ info ! ( "Getting client token" ) ;
6263 let client_token = self . session ( ) . spclient ( ) . client_token ( ) . await ?;
64+ info ! ( "Got client token: {client_token}" ) ;
6365 let body = message. write_to_bytes ( ) ?;
6466
6567 let request = Request :: builder ( )
@@ -73,6 +75,7 @@ impl Login5Manager {
7375 }
7476
7577 async fn login5_request ( & self , login : Login_method ) -> Result < LoginOk , Error > {
78+ info ! ( "Login5 Req" ) ;
7679 let client_id = match OS {
7780 "macos" | "windows" => self . session ( ) . client_id ( ) ,
7881 // StoredCredential is used to get an access_token from Session credentials.
@@ -100,20 +103,23 @@ impl Login5Manager {
100103 count += 1 ;
101104
102105 let message = LoginResponse :: parse_from_bytes ( & response) ?;
106+ info ! ( "response: {message}" ) ;
103107 if let Some ( Response :: Ok ( ok) ) = message. response {
104108 break Ok ( ok) ;
105109 }
106110
107111 if message. has_error ( ) {
108112 match message. error ( ) {
109113 LoginError :: TIMEOUT | LoginError :: TOO_MANY_ATTEMPTS => {
114+ info ! ( "Login5 timeouting.." ) ;
110115 sleep ( LOGIN_TIMEOUT ) . await
111116 }
112117 others => return Err ( Login5Error :: FaultyRequest ( others) . into ( ) ) ,
113118 }
114119 }
115120
116121 if message. has_challenges ( ) {
122+ info ! ( "Login5 challenges.." ) ;
117123 // handles the challenges, and updates the login context with the response
118124 Self :: handle_challenges ( & mut login_request, message) ?;
119125 }
@@ -142,6 +148,7 @@ impl Login5Manager {
142148 // by manipulating the user-agent and client-id it can be also used/tested on desktop
143149 return Err ( Login5Error :: OnlyForMobile . into ( ) ) ;
144150 }
151+ info ! ( "logging in using {OS}" ) ;
145152
146153 let method = Login_method :: Password ( Password {
147154 id : id. into ( ) ,
@@ -155,6 +162,8 @@ impl Login5Manager {
155162 token_response. access_token_expires_in ,
156163 ) ;
157164
165+
166+ info ! ( "Request end" ) ;
158167 Ok ( ( auth_token, token_response. stored_credential ) )
159168 }
160169
@@ -164,6 +173,9 @@ impl Login5Manager {
164173 /// stored credentials generated with the keymaster client-id will not work, for example, with
165174 /// the android client-id.
166175 pub async fn auth_token ( & self ) -> Result < Token , Error > {
176+ info ! ( "Using auth_token!" ) ;
177+ let client_id = self . session ( ) . client_id ( ) ;
178+ info ! ( "ClientID: {client_id}" ) ;
167179 let auth_data = self . session ( ) . auth_data ( ) ;
168180 if auth_data. is_empty ( ) {
169181 return Err ( Login5Error :: NoStoredCredentials . into ( ) ) ;
0 commit comments