class AccessDeniedSubscriber implements EventSubscriberInterface (View source)

Redirects users when access is denied.

Anonymous users are taken to the login page when attempting to access the user profile pages. Authenticated users are redirected from the login form to their profile page and from the user registration form to their profile edit form.

Properties

protected AccountInterface $account

The current user.

Methods

__construct(AccountInterface $account)

Constructs a new redirect subscriber.

onException(ExceptionEvent $event)

Redirects users when access is denied.

static 
getSubscribedEvents()

{@inheritdoc}

Details

__construct(AccountInterface $account)

Constructs a new redirect subscriber.

Parameters

AccountInterface $account

The current user.

onException(ExceptionEvent $event)

Redirects users when access is denied.

Parameters

ExceptionEvent $event

The event to process.

static getSubscribedEvents()

{@inheritdoc}