cartalyst / sentinel

A framework agnostic authentication & authorization system.
BSD 3-Clause "New" or "Revised" License
1.51k stars 238 forks source link

Sentinel Throttle implementation. getThrottleRepository returning null. #444

Closed alankarglobant closed 5 years ago

alankarglobant commented 6 years ago

The documentation is also not supportive for throttle implementation. Sentinel::getThrottleRepository() return null.

Call to a member function setUserThresholds() on null error returns when : $throttle = Sentinel::getThrottleRepository()->setUserThresholds(5);

alankarglobant commented 6 years ago

Sorry for the Sentry check issue it was the middleware integration not related with the Sentinel. Apologies for the same.

brunogaspar commented 5 years ago

It seems the Throttling repository is not being set on the Sentinel instance, only on the Checkpoint.

Adding $sentinel->setThrottleRepository($app['sentinel.throttling']); around line 321 of the SentinelServiceProvider seems to solve the problem.

@suwardany Was there any reason or was pretty much forgotten?