Comments (9)
Wow! Interesting to know!
Thank you for clarifying! Using a hash prefix (or suffix) is a good idea to solve this issue. I'll leave this issue open as a reminder for myself to implement this 👍🏼
Thank you!
from igdb-laravel.
Hi @adzay,
this is weird indeed as it is working just normally over here.
The bearer token does not get updated automatically by updating your client secret but the token is cached for the token lifetime (expires_in
). So when your token expires (or by running php artisan cache:forget igdb_cache.access_token
) the next time you query something a fresh access token is retrieved automatically (using your new client secret).
The webhook url responded with: 405
leads me into the direction something is not working properly for how you registered the webhook url inside your application. As you might know prior to v3 of this package you needed to create a URL to handle the webhook yourself. So you may have registered it as as GET
url as the 405
error states the method it called (POST
) is not allowed.
When upgrading to v3 of this package the url registration is done automatically (but you may need to re-create your webhooks as the handling url has changed). The new automatically registered url is /igdb-webhook/handle/{endpoint}/{method}
as you may see when running php artisan route:list
.
I hope this helps. Just let me know if we may need to dig a little deeper.
from igdb-laravel.
Hi,
I have igdb-webhook/handle/{model}/{method}
in my route:list so that is working fine. I deleted via composer, re added and republished the config too. Also my App_URL has my live website url. Which is why after i followed your instructions last week it worked perfectly. But now i feel i am back to square one lol.
I tried your advice on the cache and it still doesnt work via CLI.
I put Game::createWebhook(Method::UPDATE);
in my homepage controller, and that does nothing too. lol i am very confused :S.
Edit: This is also the same on the live website, not just local. The commands do nothing.
from igdb-laravel.
Hm, weird.
When you got the Error sending test JSON, Webhook url responded with: 405
error from testing the webhook, did anything got logged into your storage/logs/laravel.log
?
from igdb-laravel.
Hi, Nothing in my logs at all
from igdb-laravel.
Well, now I'm confused as well 😅
May I ask you to create a fresh Laravel app, install the package and try registering a webhook over there? Just to make sure, there isn't something broken inside your real app.
from igdb-laravel.
You may bring your local test application online using https://expose.dev/ (Just make sure you enter the random url you got into your APP_URL
).
from igdb-laravel.
Hi I think i figured it out. So the issue is due to me changing my Twitch client key/secret (lets not go into why lol).
It looks like if the twitch client id is changed the same webhook path handle cannot be used unless you delete the original.
For example this package submitted the below url initially to register the webhook:
https://website.com/igdb-webhook/handle/games/update
After changing my Twitch id, i tried to create another webhook with the new credentioals. But the same url above was submitted. IGDB found that URL, but it had the OLD twitch id. This is why your package couldn't see/create any new webhooks.
A bit messy for me to explain but i fixed it by adding a prefix to the webhook handle
'webhook_path' => 'igdb-webhook/handle',
'webhook_path' => 'new-igdb-webhook/handle',
Obviously it may not be often someone changes their twitch id like me, but to automate, maybe you could look into generating a 6-8 letter hashID from the twich_client_id and adding it to the front of the webhook handle.
from igdb-laravel.
@adzay Sooo, I've just released v3.3.0 which adds the hashed client_id
as a suffix to igdb.webhook_path
. So the new URL is https://example.com/igdb-webhook/handle/d41d8cd9/games/update
for example. The old URL without the hash remains supported but is "marked" as deprecated and will be removed in the next major release. Otherwise this release would have been a breaking change.
So in order to be ready for v4 you may recreate your webhooks now so they get generated with the new hash "syntax".
Thank you again for pointing this out! I really appreciate it!
from igdb-laravel.
Related Issues (20)
- cover issue and genres
- Generate cover Array HOT 2
- Where do i place "Game::createWebhook"? HOT 3
- Add more info in the Readme on how to search with "Like" HOT 8
- Laravel HTTP request returned status code 401 "Authorization Failure" HOT 5
- Webhooks CLI not working HOT 6
- Platform Logos HOT 1
- How to access $event name in webhooks HOT 2
- HTTP request returned status code 400: [ { "title": "Syntax Error", "status": 400 } ] HOT 1
- 401 Error with Token HOT 6
- title": "Syntax Error" HOT 5
- Only get official releases HOT 1
- Error when setting up relationships between IGDBLaravel\Models and regular Models HOT 6
- Multiple Models missing HOT 1
- Game cover give me an array instead an object HOT 4
- Call to a member function getUrl() on array HOT 2
- Feature Request: Add Event Endpoint HOT 7
- Weird issue after the update to 4.1.0 HOT 4
- Extracting a list of available platforms HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from igdb-laravel.