PreProcessor\ValidateAuthCode
Validates an auth code generated with Finisher\GenerateAuthCode.
If you have a registration form which sends an auth code to the user by email, you can use this PreProcessor to validate the auth code directly on the form page with no need to write additional PHP code.
These steps are required to make a working auth code validation:
- Create the record using Finisher\DB. Make sure you set the record inactive at first (e.g. set hidden to 1).
- Send an auth code generated with Finisher\GenerateAuthCode to the user.
- Validate the auth code with PreProcessor\ValidateAuthCode. Configure the used hiddenField in TypoScript.
- If the auth code is valid, Formhandler sets the hiddenField to 0 and redirects the user to the specified redirectPage. If the code is invalid, the user is redirected to the specified errorRedirectPage.
Properties
.redirectPage
Redirects to this page if the validation is successful
Data type
String | cObj
Version added
1.0.0
.errorRedirectPage
Redirects to this page if an error occurred
Data type
String | cObj
Version added
1.0.0
.hiddenField
The column name indicating the hidden state (e.g. hidden or disable)
Data type
String | cObj
Default value
“disable” or taken from TCA if set
Version added
1.0.0
.hiddenStatusValue
Allows to define a custom value for a hidden record.
Data type
String | cObj
Default value
1
Version added
1.7.0
.activeStatusValue
Allows to define a custom value for an active record.
Data type
Boolean
Version added
1.7.0
.showDeleted
If set to "1", PreProcessor_ValidateAuthCode select records marked as deleted when searching for the record.
Data type
Boolean | cObj
Version added
1.7.0
.selectFields
The database fields to be used to generate the comparison auth code.
Data type
Comma separated list | cObj
Default value
*
Version added
1.0.0
.table
Configure a table name to be used for the select. This is only needed if the parameter table is excluded from the auth code URL.
Data type
String | cObj
Version added
2.0.0
.uidField
Configure the uid field name to be used for the select. This is only needed if the parameter uidField is excluded from the auth code URL.
Data type
String | cObj
Default value
uid
Version added
2.0.0