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:

Version added

1.0.0

TypoScript path

plugin.Tx_Formhandler.settings.preProcessors.x copy to clipboard

Important

Add PreProcessor_LoadGetPost before PreProcessor_ValidateAuthCode!

Example code

preProcessors {
  5 {
    class = PreProcessor_LoadGetPost
  }
  10 {
    class = PreProcessor_ValidateAuthCode
    config {
     
      # Redirect to this page if the validation is successful
      redirectPage = 50

      # Redirect to this page if there is an error
      errorRedirectPage = 51
    }
  }
}

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

.correctRedirectUrl

Replaces  '&' with '&' in URL

Data type

Boolean | cObj

Version added

1.0.0

.additionalParams

Add additional parameters to the redirect URL. Each parameter can be a string or a TypoScript object.

Data type

Array

Version added

1.0.0

.headerStatusCode

Set a custom header code set when redirecting to another page.

Data type

String | cObj

Default value

307 Temporary Redirect

Version added

1.3.0