class PostLoginLocation (View source)

Class to handle the URL to redirect users to upon login.

Constants

POSTLOGIN_SESSION_KEY

The session key to be used to store the post-login URL.

Properties

protected Repository $config
protected Session $session
protected ResolverManagerInterface $resolverManager
protected ResponseFactoryInterface $responseFactory
protected Numbers $valn

Methods

__construct(Repository $config, Session $session, ResolverManagerInterface $resolverManager, ResponseFactoryInterface $responseFactory, Numbers $valn)

Initialize the instance.

resetSessionPostLoginUrl()

Clear the post-login data saved in session.

setSessionPostLoginUrl(string|URLInterface|Page|int $url)

Store in the session the post-login URL or page.

string
getSessionPostLoginUrl(bool $resetSessionPostLoginUrl = false)

Get the post-login URL as stored in the session.

string
getDefaultPostLoginUrl()

Get the default post-login URL.

string
getFallbackPostLoginUrl()

Get the fallback post-login URL (called when all other methods fail).

string
getPostLoginUrl(bool $resetSessionPostLoginUrl = false)

Get the post-login URL.

Response
getPostLoginRedirectResponse(bool $resetSessionPostLoginUrl = false)

Create a Response that redirects the user to the configured URL.

Details

__construct(Repository $config, Session $session, ResolverManagerInterface $resolverManager, ResponseFactoryInterface $responseFactory, Numbers $valn)

Initialize the instance.

Parameters

Repository $config
Session $session
ResolverManagerInterface $resolverManager
ResponseFactoryInterface $responseFactory
Numbers $valn

resetSessionPostLoginUrl()

Clear the post-login data saved in session.

setSessionPostLoginUrl(string|URLInterface|Page|int $url)

Store in the session the post-login URL or page.

Parameters

string|URLInterface|Page|int $url

the URL to redirect users to after login

string getSessionPostLoginUrl(bool $resetSessionPostLoginUrl = false)

Get the post-login URL as stored in the session.

Parameters

bool $resetSessionPostLoginUrl

Should the post-login-related data stored in session be cleared?

Return Value

string

Empty string if unavailable

string getDefaultPostLoginUrl()

Get the default post-login URL.

Return Value

string

Empty string if unavailable

string getFallbackPostLoginUrl()

Get the fallback post-login URL (called when all other methods fail).

Return Value

string

string getPostLoginUrl(bool $resetSessionPostLoginUrl = false)

Get the post-login URL.

Parameters

bool $resetSessionPostLoginUrl

Should the post-login-related data stored in session be cleared?

Return Value

string

Response getPostLoginRedirectResponse(bool $resetSessionPostLoginUrl = false)

Create a Response that redirects the user to the configured URL.

Parameters

bool $resetSessionPostLoginUrl

Should the post-login-related data stored in session be cleared?

Return Value

Response