before_authenticate hook[Permalink]Return to Application Delegate Class The before_authenticate hook is a method that can be defined in the Application Delegate Class which is called before the authentication step occurs on every request (not just on login). It is meant to be used to perform custom code that may affect the authentication settings. SinceThis hook has been available since Xataface Version 1.2.5. Example
In the above example we used a separate action to store the user's preferred login type in a session variable. This preference is then applied in the before_authenticate method to override the authentication type. Chain Authentication SupportThe most common use of this hook is likely to implement some sort of chain authentication, where authentication methods are attempted until one succeeds. See Also
|