@@ -121,6 +121,7 @@ public async void Login()
121
121
ShowOutput ( "Called Login()..." ) ;
122
122
LoginButton . gameObject . SetActive ( false ) ;
123
123
124
+ #if ( UNITY_ANDROID && ! UNITY_EDITOR_WIN ) || ( UNITY_IPHONE && ! UNITY_EDITOR_WIN ) || UNITY_STANDALONE_OSX
124
125
if ( SampleAppManager . UsePKCE )
125
126
{
126
127
await passport . LoginPKCE ( ) ;
@@ -129,6 +130,9 @@ public async void Login()
129
130
{
130
131
await passport . Login ( ) ;
131
132
}
133
+ #else
134
+ await passport . Login ( ) ;
135
+ #endif
132
136
133
137
SampleAppManager . IsConnected = false ;
134
138
NavigateToAuthenticatedScene ( ) ;
@@ -189,6 +193,7 @@ public async void Connect()
189
193
ShowOutput ( "Called Connect()..." ) ;
190
194
ConnectButton . gameObject . SetActive ( false ) ;
191
195
196
+ #if ( UNITY_ANDROID && ! UNITY_EDITOR_WIN ) || ( UNITY_IPHONE && ! UNITY_EDITOR_WIN ) || UNITY_STANDALONE_OSX
192
197
if ( SampleAppManager . UsePKCE )
193
198
{
194
199
await passport . ConnectImxPKCE ( ) ;
@@ -197,6 +202,9 @@ public async void Connect()
197
202
{
198
203
await passport . ConnectImx ( ) ;
199
204
}
205
+ #else
206
+ await passport . ConnectImx ( ) ;
207
+ #endif
200
208
201
209
SampleAppManager . IsConnected = true ;
202
210
NavigateToAuthenticatedScene ( ) ;
@@ -252,13 +260,24 @@ public async void Reconnect()
252
260
253
261
private async UniTask Logout ( )
254
262
{
255
- if ( SampleAppManager . UsePKCE )
263
+ try
256
264
{
257
- await passport . LogoutPKCE ( ) ;
265
+ #if ( UNITY_ANDROID && ! UNITY_EDITOR_WIN ) || ( UNITY_IPHONE && ! UNITY_EDITOR_WIN ) || UNITY_STANDALONE_OSX
266
+ if ( SampleAppManager . UsePKCE )
267
+ {
268
+ await passport . LogoutPKCE ( ) ;
269
+ }
270
+ else
271
+ {
272
+ await passport . Logout ( ) ;
273
+ }
274
+ #else
275
+ await passport . Logout ( ) ;
276
+ #endif
258
277
}
259
- else
278
+ catch ( Exception ex )
260
279
{
261
- await passport . Logout ( ) ;
280
+ ShowOutput ( $ " Logout() error: { ex . Message } " ) ;
262
281
}
263
282
}
264
283
0 commit comments