<?php

namespace Modules\Base\Listeners;

use \Illuminate\Auth\Events\Authenticated;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;

class AuthenticatedListener
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Handle the event.
     *
     * @param Authenticated $event
     * @return void
     */
    public function handle(Authenticated $event)
    {
        if ($event->user->is_blocked == 1) {
            auth()->logout(true);
            //abort(500, '账户已经禁用');
        }
    }
}
