auth icon indicating copy to clipboard operation
auth copied to clipboard

Would be nice to have support for activation/deactivation of user accounts, as well as throttling of accounts (ability to suspend or ban users).

Open homebrewerluke opened this issue 13 years ago • 4 comments

homebrewerluke avatar Nov 26 '13 17:11 homebrewerluke

I think account activation and deactivation should be under Orchestra/Model. As far as I know there's a plan to support user throttling but that will be under Orchestra/Throttle

ahmadshah avatar Nov 26 '13 20:11 ahmadshah

Throttling is under consideration in https://github.com/orchestral/throttle (no code yet). For activation and deactivation I'm open for suggestion on how we should do it on orchestra/auth level.

Additionally I'm also working on https://github.com/orchestral/warden (detail in orchestral/warden#1).

crynobone avatar Nov 26 '13 22:11 crynobone

For me on orchestra/auth would be nice to have something like

Auth::attempt($credentials);
if (Auth::isUnverified())
{
   ....
}

So that we can verify user status on login. As for changing the status that can be included in the user model.

ahmadshah avatar Nov 27 '13 11:11 ahmadshah

Orchestra\Model\User already has few constant that we can utilize (see https://github.com/orchestral/model/blob/master/src/Orchestra/Model/User.php#L15), however Eloquent driver is only enforced when you're using it with Orchestra Platform, as a component, we still need to append/handle it via Illuminate\Auth\GenericUser as well.

The end result should be something as:

if (Auth::attempt($credentials))
{
    // Unverified user should still be able to logged in.
    // However we could notify the user that the user has yet to be verified.
    if ( ! Auth::user()->isVerified()) {
         Orchestra\Message::extend(function ($m) {
             $m->add('error', 'Your account is yet to be verified!');
         });
    }
}

crynobone avatar Nov 27 '13 12:11 crynobone