@@ -27,51 +27,52 @@ void Start()
2727 ShowOutput ( "Passport Instance is null" ) ;
2828 }
2929
30- // Set up button listeners if buttons are assigned
31- if ( DefaultLoginButton != null ) DefaultLoginButton . onClick . AddListener ( ( ) => Login ( DirectLoginMethod . None ) ) ;
32- if ( GoogleLoginButton != null ) GoogleLoginButton . onClick . AddListener ( ( ) => Login ( DirectLoginMethod . Google ) ) ;
33- if ( AppleLoginButton != null ) AppleLoginButton . onClick . AddListener ( ( ) => Login ( DirectLoginMethod . Apple ) ) ;
34- if ( FacebookLoginButton != null ) FacebookLoginButton . onClick . AddListener ( ( ) => Login ( DirectLoginMethod . Facebook ) ) ;
30+ // Set up button listeners using DirectLoginOptions
31+ if ( DefaultLoginButton != null ) DefaultLoginButton . onClick . AddListener ( ( ) => Login ( new DirectLoginOptions ( ) ) ) ;
32+ if ( GoogleLoginButton != null ) GoogleLoginButton . onClick . AddListener ( ( ) => Login ( new DirectLoginOptions ( DirectLoginMethod . Google ) ) ) ;
33+ if ( AppleLoginButton != null ) AppleLoginButton . onClick . AddListener ( ( ) => Login ( new DirectLoginOptions ( DirectLoginMethod . Apple ) ) ) ;
34+ if ( FacebookLoginButton != null ) FacebookLoginButton . onClick . AddListener ( ( ) => Login ( new DirectLoginOptions ( DirectLoginMethod . Facebook ) ) ) ;
3535 }
3636
3737 /// <summary>
3838 /// Logs into Passport using the default auth method.
3939 /// </summary>
4040 public async void Login ( )
4141 {
42- await LoginAsync ( DirectLoginMethod . None ) ;
42+ await LoginAsync ( new DirectLoginOptions ( ) ) ;
4343 }
4444
4545 /// <summary>
46- /// Logs into Passport using the specified direct login method .
46+ /// Logs into Passport using the specified direct login options .
4747 /// </summary>
48- /// <param name="directLoginMethod ">The direct login method to use (Google, Apple, Facebook, or None for default) </param>
49- public async void Login ( DirectLoginMethod directLoginMethod )
48+ /// <param name="directLoginOptions ">The direct login options </param>
49+ public async void Login ( DirectLoginOptions directLoginOptions )
5050 {
51- await LoginAsync ( directLoginMethod ) ;
51+ await LoginAsync ( directLoginOptions ) ;
5252 }
5353
5454 /// <summary>
5555 /// Internal async method that performs the actual login logic.
5656 /// </summary>
57- /// <param name="directLoginMethod ">The direct login method to use </param>
58- private async System . Threading . Tasks . Task LoginAsync ( DirectLoginMethod directLoginMethod )
57+ /// <param name="directLoginOptions ">The direct login options </param>
58+ private async System . Threading . Tasks . Task LoginAsync ( DirectLoginOptions directLoginOptions )
5959 {
6060 try
6161 {
62- string methodName = directLoginMethod == DirectLoginMethod . None ? "default" : directLoginMethod . ToString ( ) ;
63- ShowOutput ( $ "Logging in with { methodName } method...") ;
62+ string directLoginMethod = directLoginOptions . directLoginMethod . ToString ( ) . ToLower ( ) ;
6463
65- bool success = await Passport . Login ( useCachedSession : false , directLoginMethod : directLoginMethod ) ;
64+ ShowOutput ( $ "Logging in with { directLoginMethod } method...") ;
65+
66+ bool success = await Passport . Login ( useCachedSession : false , directLoginOptions : directLoginOptions ) ;
6667
6768 if ( success )
6869 {
69- ShowOutput ( $ "Successfully logged in with { methodName } ") ;
70+ ShowOutput ( $ "Successfully logged in with { directLoginMethod } ") ;
7071 SceneManager . LoadScene ( "AuthenticatedScene" ) ;
7172 }
7273 else
7374 {
74- ShowOutput ( $ "Failed to log in with { methodName } ") ;
75+ ShowOutput ( $ "Failed to log in with { directLoginMethod } ") ;
7576 }
7677 }
7778 catch ( OperationCanceledException ex )
0 commit comments