Skip to content

Commit

Permalink
Merge pull request #348 from tzrot-jed/oauth_fix_local_redirect_port
Browse files Browse the repository at this point in the history
Redirect to correct local port after OAuth2 success
  • Loading branch information
WolfgangSenff authored Jan 11, 2024
2 parents 7b90285 + c2acbe3 commit 5f2d638
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion addons/godot-firebase/auth/auth.gd
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,13 @@ var _update_profile_body: Dictionary = {
"returnSecureToken": true,
}

var _local_port: int = 8060
var _local_port: int = 8060 setget _set_local_port
var _local_uri: String = "http://localhost:%s/" % _local_port
var _local_provider: AuthProvider = AuthProvider.new()

func _set_local_port(value: int) -> void:
_local_port = value
_local_uri = "http://localhost:%s" % _local_port

func _ready() -> void:
tcp_timer.wait_time = tcp_timeout
Expand Down Expand Up @@ -251,6 +254,7 @@ func login_with_custom_token(token: String) -> void:
# Once given user's authorization, a token will be generated.
# NOTE** the generated token will be automatically captured and a login request will be made if the token is correct
func get_auth_localhost(provider: AuthProvider = get_GoogleProvider(), port: int = _local_port):
_set_local_port(port)
get_auth_with_redirect(provider)
yield(get_tree().create_timer(0.5),"timeout")
if has_child == false:
Expand Down

0 comments on commit 5f2d638

Please sign in to comment.