AdvertAuthorizationFormTrait
Lets a guest log in to edit an advert with the advert password.
Shown through setView('authorizationForm') directly in the edit action: the URL does not
change and no new route is needed. After a correct password a token [id, hash, expiration]
is stored in the session, which checkAutorization() in EditAdvertFormTrait verifies on
every access.
Tags
Table of Contents
Constants
- advertSessionExpiration : mixed = 7200
Properties
Methods
- authFormSucceeded() : void
- createComponentAuthForm() : Form
- createComponentForgotPasswordForm() : ForgotPasswordForm
- refreshAdvertSession() : void
- Updates the session token after editing: rewrites the hash and extends the expiration.
- renderAuthorizationForm() : void
Constants
advertSessionExpiration
private
mixed
advertSessionExpiration
= 7200
Properties
$forgotPasswordFormFactory
public
ForgotPasswordFormFactory
$forgotPasswordFormFactory
Attributes
- #[Inject]
$frontFormLimiter
public
FrontFormLimiter
$frontFormLimiter
Attributes
- #[Inject]
Methods
authFormSucceeded()
public
authFormSucceeded(Form $form, ArrayHash $values) : void
Parameters
- $form : Form
- $values : ArrayHash
createComponentAuthForm()
public
createComponentAuthForm() : Form
Return values
FormcreateComponentForgotPasswordForm()
public
createComponentForgotPasswordForm() : ForgotPasswordForm
Return values
ForgotPasswordFormrefreshAdvertSession()
Updates the session token after editing: rewrites the hash and extends the expiration.
public
refreshAdvertSession(Advert $advert) : void
Call it after a successful save, when $advert->getPassword() holds the new hash.
Parameters
- $advert : Advert
renderAuthorizationForm()
public
renderAuthorizationForm() : void