#Laravel socialite "Too many requests" callback error
10 messages · Page 1 of 1 (latest)
This is my custom AuthController which handles my 3rd party login
public function oauthCallback(string $provider): JsonResponse
{
try {
$user = Socialite::driver($provider)->user();
$user = DB::connection('whmcs')
->table('tblaffiliates_data')
->where('clientid', $user->id ?? 0)
->where('categories', '!=', '[]')
->where('archived', 0)
->first();
return new JsonResponse([
'item' => 'userlogged-in',
'user' => $user
]);
} catch (Exception $e) {
dd($e);
return Redirect::route('auth.login', ['oauth=failed']);
}
I tried to add dd() above the $user variable however it doesn't seem to get passed even the `dd() function
This is what handles my oauthRedirect
public function oauthRedirect(string $provider): JsonResponse
{
return new JsonResponse(['redirect' => Socialite::with('whmcs')->setScopes(['openid', 'email', 'profile'])->redirect()->getTargetUrl()]);
}
Note I get redirected but after I authorized the account it will display "Too many requests" error
I don't know what whmcs is, but it sounds like you're getting rate limited. Check their documentation.
This is the url of my project which I get rate limited I think not the whmcs
https://partners-oliver.bisectdev.com/
Btw I also edited out the kernel and remove ratelimiter
I am using "auth" middlewareGroup
Are you sure you're not causing an infinite redirect which is then being throttled? You can use the network tab in your browser's devtools to see the requests (you might have to enable "preserve log"), then you could see what's happening