File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -405,7 +405,7 @@ void CancelLogin(object? sender, ConsoleCancelEventArgs e)
405
405
Console . WriteLine ( $ "Authorization to { mailServer } service. Press Ctrl+C to cancel the operation.") ;
406
406
AuthCredential authCredential = await authClient . LoginAsync ( cancellationLogin . Token ) . ConfigureAwait ( false ) ;
407
407
408
- string ? email = await ReadEmailAddressAsync ( authCredential ) . ConfigureAwait ( false ) ;
408
+ string ? email = await ReadEmailAddressAsync ( authClient , authCredential ) . ConfigureAwait ( false ) ;
409
409
410
410
if ( ! string . IsNullOrEmpty ( email ) )
411
411
{
@@ -485,17 +485,18 @@ private void OnCoreException(object? sender, ExceptionEventArgs e)
485
485
_application . WriteError ( e . Exception ) ;
486
486
}
487
487
488
- private static async Task < string ? > ReadEmailAddressAsync ( AuthCredential authCredential )
488
+ private static async Task < string ? > ReadEmailAddressAsync ( IAuthorizationClient client , AuthCredential credential )
489
489
{
490
- ArgumentNullException . ThrowIfNull ( authCredential ) ;
490
+ ArgumentNullException . ThrowIfNull ( client ) ;
491
+ ArgumentNullException . ThrowIfNull ( credential ) ;
491
492
492
- if ( authCredential is IProfileReader profileReader )
493
+ if ( client is IProfileReader profileReader )
493
494
{
494
- IUserProfile profile = await profileReader . ReadProfileAsync ( authCredential ) . ConfigureAwait ( false ) ;
495
+ IUserProfile profile = await profileReader . ReadProfileAsync ( credential ) . ConfigureAwait ( false ) ;
495
496
return profile . Email ;
496
497
}
497
498
498
- return authCredential . ReadEmailAddress ( ) ;
499
+ return credential . ReadEmailAddress ( ) ;
499
500
}
500
501
}
501
502
}
You can’t perform that action at this time.
0 commit comments