Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

The authentication_login_form tag renders a form that allows the visitor to login as a certain Authentication Type.

The authentication_login_form tag takes the plural name of an Authentication Type as input. 

It is also possible to give extra arguments as a key,value pair. These arguments are transformed into html attributes on the generated form html tag.

The authentication_login_form tag requires that the authentication_field tag is called inside of it for each of the inputs:

  • 'email'

  • 'password'

Accepts parameter redirect_to, with a path that the user is redirected to after successful login.

Also accepts a parameter error_msg to use a custom message when logging in does not work, for example when the wrong credentials are used.

Example:

{% authentication_login_form "dealers", error_msg: "custom error message", redirect_to: "/portal-page" %}
    {% authentication_field "email", class: "form-field" %}
    {% authentication_field "password", class: "form-field" %}
    <input type="submit" value="Login!">
{% endauthentication_login_form %}

Note: Do not forget to display the output of [request.flash], since that contains potential error messages.

  • No labels