AdvertAuthorizationFormTrait
Lets a guest authorize to edit a company profile with a password.
Shown through setView('authorizationForm') directly in the edit action, so the URL stays
and no new route is needed. After a correct password the session stores the token
[id, hash, expiration], 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
- Refreshes the session token after an edit: 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()
Refreshes the session token after an edit: 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