Update redirecting_flow.gd

Automatically close the browser response window if authentication was successful.
This commit is contained in:
trgKai 2023-12-19 12:24:53 -08:00 committed by GitHub
parent 9180cfa092
commit 5987a59684
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,7 +54,7 @@ func _handle_empty_response() -> void:
func _handle_success(data : Dictionary) -> void: func _handle_success(data : Dictionary) -> void:
data["scope"] = data["scope"].uri_decode().split(" ") data["scope"] = data["scope"].uri_decode().split(" ")
print("Success.") print("Success.")
send_response("200 OK", "<html><head><title>Twitch Login</title></head><body>Success!</body></html>".to_utf8_buffer()) send_response("200 OK", "<html><head><title>Twitch Login</title></head><body onload=\"javascript:close()\">Success!</body></html>".to_utf8_buffer())
func _handle_error(data : Dictionary) -> void: func _handle_error(data : Dictionary) -> void:
var msg = "Error %s: %s" % [data["error"], data["error_description"]] var msg = "Error %s: %s" % [data["error"], data["error_description"]]