issork / gift

Godot IRC For Twitch addon
MIT License
153 stars 22 forks source link

Broken Asset Store addon #33

Closed JD-The-65th closed 12 months ago

JD-The-65th commented 1 year ago

Hey, I'm trying to use this addon in my 4.2beta2 project but it seems to be broken.

I've set the auth file in my project file to be formatted like required, and I even put all of the info inside of the gift.gd script itself, but it seems to be broken, at least on my Steam Deck, where it just opens a "404 page not found" link to https://id.twitch.tv/oauth2/authorize/`everythingelse`

My application's OAuth Redirect URL is set to http://localhost

mrTag commented 1 year ago

Your redirect URL seems to be missing the port. It has to be set exactly to http://localhost:18297 I just had a superfluous / at the end of the URL and it didn't work.

JD-The-65th commented 1 year ago

Weird, I'm gonna try this when I get back home

JD-The-65th commented 12 months ago

I've set my oauth redirect url to be "http://localhost:18297" but it still doesn't work. It doesn't look like it's sending the client secret, so I'm going to send the link it generates.

https://id.twitch.tv/oauth2/authorize%0A%09?response_type=code%0A%09&client_id=c1vdqvcpqtv5gzohx07cgaydytoa9i&redirect_uri=http://localhost:18297%0A%09&scope=chat%3Aedit%20chat%3Aread

mrTag commented 12 months ago

The URL has weird %0A%09 characters in them. I just tried removing them from your link and tada: a twitch authentication window pops up! Looks like this: https://id.twitch.tv/oauth2/authorize?response_type=code&client_id=c1vdqvcpqtv5gzohx07cgaydytoa9i&redirect_uri=http://localhost:18297&scope=chat%3Aedit%20chat%3Aread

I also tried an online URL decoder to see what the %0A%09 decodes to and it is a newline followed by a tab. Did you somehow mess with the URL generation code? That is how that line should look like: https://github.com/issork/gift/blob/204928ad5c319b22f62c44ca361811cfe13e357c/addons/gift/gift_node.gd#L188

JD-The-65th commented 12 months ago

I didn't mess with the URL generation code. I got this addon off of the Godot Asset store, so maybe that has something to do with it. I'm gonna try to replace the line in my script with that line.

JD-The-65th commented 12 months ago

Somehow, the line got split up in the Addon Store version of this plugin... Weird. OS.shell_open("https://id.twitch.tv/oauth2/authorize ?response_type=code &client_id=" + client_id + "&redirect_uri=http://localhost:18297 &scope=" + scope)

JD-The-65th commented 12 months ago

Forgot to respond, it works perfectly after replacing the line in the local script with the line above. Somehow, the asset store version has that line split.

issork commented 12 months ago

Oh, I too forgot to respond. This was fixed in #23, but I seem to have forgotten to release it to the asset store, thanks!