Fire the authenticated event if the dispatcher is set.

@param  \Illuminate\Contracts\Auth\Authenticatable  $user
@return void
976510
protected function fireAuthenticatedEvent($user)
    {
        if (isset($this->events)) {
            $this->events->dispatch(new Events\Authenticated(
                $this->name, $user
            ));
        }
    }
82243
protected function callAuthCallback(User $user, $ability, array $arguments)
    {
        $callback = $this->resolveAuthCallback($user, $ability, $arguments);

        return call_user_func_array($callback, array_merge(array($user), $arguments));
    }
196368
public function requestNewPassword(User $user)
    {
        $user->setPasswordRequestedAt(new \DateTime());
        $user->resetAuthenticationToken();
        $user->setEmailSent(false);
        $this->save($user);
    }
1336391
public function handle(UserRegistered $event)
    {
        //try {
        $user = $this->users->findBy('id', $event->user_id);
        $user->notify(new RegistrationEmail($user));
        //} catch(\Exception $e) {
        //Log::error('lavoro fallito');
        //}

    }
746575
public function iAuthenticateAs($user)
    {
        if (!isset($this->users[$user])) {
            throw new ClientErrorResponseException(
                'User ' . $user . ' does not exist'
            );
        }

        $this->addGuzzleHeader(
            'Authorization',
            'Bearer ' . $this->users[$user]
        );
    }
1077062
public function grantTo($user): void
    {
        $userModel = config('auth.providers.users.model');

        if (is_int($user) && !$userModel::find($user)) {
            return;
        }

        $this->users()->attach($user);
    }
565307
protected function fireFailedEvent($user, array $credentials)
    {
        if (isset($this->events)) {
            $this->events->dispatch(new Events\Failed(
                $this->name, $user, $credentials
            ));
        }
    }
177217
protected function queueRecallerCookie(AuthenticatableContract $user)
    {
        $this->getCookieJar()->queue($this->createRecaller(
            $user->getAuthIdentifier().'|'.$user->getRememberToken().'|'.$user->getAuthPassword()
        ));
    }
801856
public function handle(UserRepository $users, Dispatcher $event)
    {
        $user = $users->find($this->id);

        $user->unban();

        $users->save($user);

        $event->fire(new UserWasUnbanned($user));
    }
700555
public function preUpdate(User $user, PreUpdateEventArgs $event)
    {
        if ($event->hasChangedField('password')) {
            $event->setNewValue('password', $this->encodePassword($user));
        }
    }
737924
public function dispatchOnPasswordRememberEvent(AbstractUserInterface $user, $recoverUrl)
    {
        $event = new PasswordRememberEvent($user, $recoverUrl);
        $this
            ->eventDispatcher
            ->dispatch(
                ElcodiUserEvents::PASSWORD_REMEMBER,
                $event
            );
    }
406210
protected function fireBindingEvent($username, $password)
    {
        if (isset($this->events)) {
            $this->events->fire(new Binding($this->connection, $username, $password));
        }
    }
723325
protected function verifyUser($user)
    {
        $user->verified = true;
        $user->verified_at = new Carbon('now');

        $user->save();

        Auth::guard($this->getGuard())->login($user);
    }
967474
public function preRemove(User $user, LifecycleEventArgs $event)
    {
        $oldAvatarImage = $user->getAvatarImage();
        if (!empty($oldAvatarImage)) {
            $this->userService->deleteAvatar($oldAvatarImage);
        }
    }
79023
public function handle(Guard $auth, Dispatcher $event)
    {
        if ($auth->check() and $auth->viaRemember()) {
            $event->fire(new UserWasRemembered($auth->user()));
        }

        if ($auth->check()) {
            return;
        }

        throw new RememberingUserFailed();
    }
515582
public function handle(UserRepository $users, PasswordResetRepository $resets, Repository $config, Mailer $mail, Dispatcher $event)
    {
        $resets->cleanUp($this->email);

        $user = $users->findByEmailAddress($this->email);

        $passwordReset = PasswordReset::generate($user);

        $resets->save($passwordReset);

        $mail->send(
            $config->get('authentication.passwordReset.email'),
            compact('user', 'passwordReset'),
            function (Message $message) use ($user, $config) {
                $message
                    ->from($config->get('authentication.passwordReset.from.email'), $config->get('authentication.passwordReset.from.name'))
                    ->to($user->email, $user->name)
                    ->subject(trans('authentication::password-reset.subject'));
            }
        );

        $event->fire(new PasswordResetLinkWasSent($passwordReset));
    }
660571
public function handle(UserRepository $users, Dispatcher $event)
    {
        $user = $users->find($this->id);

        $user->fill([
            'name' => $this->name,
            'email' => $this->email,
        ]);

        $users->save($user);

        $event->fire(new UserWasUpdated($user));
    }