Closed Ssionn closed 7 months ago
Update:
I've made a possible fix for this:
public function routes(): void
{
Route::name('auth.driver.redirect')
->whereIn('driver', array_keys($this->handlers))
->get('auth/{driver}/redirect', [AuthController::class, 'redirect']);
Route::name('auth.driver.callback')
->whereIn('driver', array_keys($this->handlers))
->match(['post', 'get'], 'auth/{driver}/callback', function ($driver) {
return app(AuthController::class)->callback($driver);
});
}
Hi @Ssionn,
That's strange, I don't think that's typical OAuth operation, as providers issue a redirect to your callback
route, which in turn is a GET request. Where have you registered your routes?
Ah okay I think I see that here as well: https://github.com/patrickbussmann/oauth2-apple
If this resolves your issue, let me know and I can patch it to match
on post/get
and then make a new release 👍
Using laravel's match works pretty good. Haven't had any issue with the POST Request since.
Ok thanks for confirming @Ssionn! I've just released v1.0.4 containing a patch for this.
Run composer update
and you're all set 🙏
Oh yeah, the funny part of all of this; Apple is the only one using post requests for this from what I can find. 😒
lol figures eh! Appreciate the detailed issue and helping me get this patched 🙏
I have this issue where the route for the callback is not accepting the POST Request. What do I change in the
routes()
function to fix this issue? Adding the URI inVerifyCsrfToken.php
doesn't work for some reason. It doesn't want to disable the csrf. It basically it only has to do with the routing.Issue:
Routes function:
VerifyCsrfToken.php: