@@ -48,6 +48,7 @@ var auth : Dictionary = {}
48
48
var _needs_refresh : bool = false
49
49
var is_busy : bool = false
50
50
var has_child : bool = false
51
+ var is_oauth_login : bool = false
51
52
52
53
53
54
var tcp_server : TCPServer = TCPServer .new ()
@@ -290,16 +291,15 @@ func get_auth_with_redirect(provider: AuthProvider) -> void:
290
291
else :
291
292
set_local_provider (provider )
292
293
OS .shell_open (url_endpoint )
293
- print (url_endpoint )
294
294
295
295
296
296
# Login with Google oAuth2.
297
297
# A token is automatically obtained using an authorization code using @get_google_auth()
298
298
# @provider_id and @request_uri can be changed
299
299
func login_with_oauth (_token : String , provider : AuthProvider ) -> void :
300
300
if _token :
301
+ is_oauth_login = true
301
302
var token : String = _token .uri_decode ()
302
- print (token )
303
303
var is_successful : bool = true
304
304
if provider .should_exchange :
305
305
exchange_token (token , _local_uri , provider .access_token_uri , provider .get_client_id (), provider .get_client_secret ())
@@ -426,7 +426,6 @@ func _on_FirebaseAuth_request_completed(result : int, response_code : int, heade
426
426
return
427
427
428
428
res = json
429
-
430
429
if response_code == HTTPClient .RESPONSE_OK :
431
430
if not res .has ("kind" ):
432
431
auth = get_clean_keys (res )
@@ -439,7 +438,7 @@ func _on_FirebaseAuth_request_completed(result : int, response_code : int, heade
439
438
440
439
if _needs_refresh :
441
440
_needs_refresh = false
442
- login_succeeded .emit (auth )
441
+ if not is_oauth_login : login_succeeded .emit (auth )
443
442
else :
444
443
match res .kind :
445
444
RESPONSE_SIGNUP :
@@ -466,6 +465,7 @@ func _on_FirebaseAuth_request_completed(result : int, response_code : int, heade
466
465
auth_request .emit (res .error .code , res .error .message )
467
466
requesting = Requests .NONE
468
467
auth_request_type = Auth_Type .NONE
468
+ is_oauth_login = false
469
469
470
470
471
471
0 commit comments