Merge pull request #37 from gigaforge/patch-1

Automatically close out browser window after authentication is done
This commit is contained in:
Max Kross 2023-12-19 21:49:15 +01:00 committed by GitHub
commit 5b37dad373
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"]]