@@ -214,7 +214,7 @@ private void Configure()
214214
215215 private void TryToLoginWithStoredSessionWallet ( )
216216 {
217- ( EOAWallet , string ) walletInfo = ( null , "" ) ;
217+ ( EOAWallet , string , string ) walletInfo = ( null , "" , "" ) ;
218218 try
219219 {
220220 walletInfo = AttemptToCreateWalletFromSecureStorage ( ) ;
@@ -234,7 +234,7 @@ private void TryToLoginWithStoredSessionWallet()
234234
235235 _sessionId = IntentDataOpenSession . CreateSessionId ( _sessionWallet . GetAddress ( ) ) ;
236236
237- SequenceWallet wallet = new SequenceWallet ( new Address ( walletInfo . Item2 ) , _sessionId , new IntentSender ( new HttpClient ( WaaSWithAuthUrl ) , walletInfo . Item1 , _sessionId , _waasProjectId , _waasVersion ) ) ;
237+ SequenceWallet wallet = new SequenceWallet ( new Address ( walletInfo . Item2 ) , _sessionId , new IntentSender ( new HttpClient ( WaaSWithAuthUrl ) , walletInfo . Item1 , _sessionId , _waasProjectId , _waasVersion ) , walletInfo . Item3 ) ;
238238
239239 EnsureSessionIsValid ( wallet ) ;
240240 }
@@ -268,19 +268,24 @@ private async Task EnsureSessionIsValid(SequenceWallet wallet)
268268 FailedLoginWithStoredSessionWallet ( "Stored session wallet is not active" ) ;
269269 }
270270
271- private ( EOAWallet , string ) AttemptToCreateWalletFromSecureStorage ( )
271+ private ( EOAWallet , string , string ) AttemptToCreateWalletFromSecureStorage ( )
272272 {
273273 ISecureStorage secureStorage = SecureStorageFactory . CreateSecureStorage ( ) ;
274274 string walletInfo = secureStorage . RetrieveString ( Application . companyName + "-" + Application . productName + "-" + _walletKey ) ;
275275 if ( string . IsNullOrEmpty ( walletInfo ) )
276276 {
277- return ( null , "" ) ;
277+ return ( null , "" , "" ) ;
278278 }
279279 string [ ] walletInfoSplit = walletInfo . Split ( '-' ) ;
280280 string privateKey = walletInfoSplit [ 0 ] ;
281281 string walletAddress = walletInfoSplit [ 1 ] ;
282+ string email = "" ;
283+ if ( walletInfoSplit . Length == 3 )
284+ {
285+ email = walletInfoSplit [ 2 ] ;
286+ }
282287 EOAWallet wallet = new EOAWallet ( privateKey ) ;
283- return ( wallet , walletAddress ) ;
288+ return ( wallet , walletAddress , email ) ;
284289 }
285290
286291 public event ILogin . OnLoginSuccessHandler OnLoginSuccess ;
@@ -374,7 +379,7 @@ public async Task ConnectToWaaS(IntentDataOpenSession loginIntent, LoginMethod m
374379 string sessionId = registerSessionResponse . sessionId ;
375380 walletAddress = registerSessionResponse . wallet ;
376381 OnLoginSuccess ? . Invoke ( sessionId , walletAddress ) ;
377- SequenceWallet wallet = new SequenceWallet ( new Address ( walletAddress ) , sessionId , new IntentSender ( new HttpClient ( SequenceLogin . WaaSWithAuthUrl ) , _sessionWallet , sessionId , _waasProjectId , _waasVersion ) ) ;
382+ SequenceWallet wallet = new SequenceWallet ( new Address ( walletAddress ) , sessionId , new IntentSender ( new HttpClient ( SequenceLogin . WaaSWithAuthUrl ) , _sessionWallet , sessionId , _waasProjectId , _waasVersion ) , email ) ;
378383 PlayerPrefs . SetInt ( WaaSLoginMethod , ( int ) method ) ;
379384 PlayerPrefs . SetString ( OpenIdAuthenticator . LoginEmail , email ) ;
380385 PlayerPrefs . Save ( ) ;
@@ -415,7 +420,7 @@ public async Task ConnectToWaaS(IntentDataOpenSession loginIntent, LoginMethod m
415420 {
416421 if ( _storeSessionWallet && SecureStorageFactory . IsSupportedPlatform ( ) )
417422 {
418- StoreWalletSecurely ( walletAddress ) ;
423+ StoreWalletSecurely ( walletAddress , email ) ;
419424 }
420425 }
421426 catch ( Exception e )
@@ -596,13 +601,13 @@ public async Task ConnectToWaaSAsGuest()
596601 await connector . ConnectToWaaSViaGuest ( ) ;
597602 }
598603
599- private void StoreWalletSecurely ( string waasWalletAddress )
604+ private void StoreWalletSecurely ( string waasWalletAddress , string email )
600605 {
601606 ISecureStorage secureStorage = SecureStorageFactory . CreateSecureStorage ( ) ;
602607 byte [ ] privateKeyBytes = new byte [ 32 ] ;
603608 _sessionWallet . privKey . WriteToSpan ( privateKeyBytes ) ;
604609 string privateKey = privateKeyBytes . ByteArrayToHexString ( ) ;
605- secureStorage . StoreString ( Application . companyName + "-" + Application . productName + "-" + _walletKey , privateKey + "-" + waasWalletAddress ) ;
610+ secureStorage . StoreString ( Application . companyName + "-" + Application . productName + "-" + _walletKey , privateKey + "-" + waasWalletAddress + "-" + email ) ;
606611 }
607612
608613 public async Task FederateAccount ( IntentDataFederateAccount federateAccount , LoginMethod method , string email )
0 commit comments