sentinel icon indicating copy to clipboard operation
sentinel copied to clipboard

how to ban user login?

Open LiXunGuan opened this issue 11 years ago • 6 comments

sentry package has ban method,in sentinel how to ban user login

LiXunGuan avatar Nov 30 '15 01:11 LiXunGuan

You need to create your own banning checkpoint.

brunogaspar avatar Nov 30 '15 03:11 brunogaspar

@brunogaspar how to custome checkpoints and use.

LiXunGuan avatar Dec 01 '15 07:12 LiXunGuan

Create the checkpoint by looking into the existing ones Sentinel already ships with https://github.com/cartalyst/sentinel/tree/2.0/src/Checkpoints (nothing is better than real code)

You have now 2 options to register the checkpoint:

  • Either by register through a binding in a service provider or similar like this https://github.com/cartalyst/sentinel/blob/2.0/src/Laravel/SentinelServiceProvider.php#L241-L248 and then add it to the config file https://github.com/cartalyst/sentinel/blob/2.0/src/config/config.php#L134
  • Or just call the Sentinel::addCheckpoint which is documented here https://cartalyst.com/manual/sentinel/2.0#functions

You're call.

brunogaspar avatar Dec 01 '15 13:12 brunogaspar

@brunogaspar thank you very much!

LiXunGuan avatar Dec 02 '15 06:12 LiXunGuan

@brunogaspar Thanks it really helped i created a checkpoint to check banned user very easily by using Sentinel::addCheckpoint.

shahidbasheer avatar May 01 '16 09:05 shahidbasheer

@shahidbasheer can you share your new checkpoints?

thanks

lorvent avatar Feb 12 '19 19:02 lorvent