pagemachine/hairu

Redirect after login

Closed this issue · 2 comments

Hi - is there a way to add a "default"-redirect to the login-form?
Use case: provide a general login-page and redirect the user to a specific page after login.

You can put a hidden form field named redirect_url in your login form which will be evaluated after the login.

thanks - i t works fine with this snippet in Templates/Authentication/ShowLoginForm.html:

  <f:if condition="{formData.redirect_url}">
    <f:then>
      <input type="hidden" name="redirect_url" value="{formData.redirect_url}"/>
    </f:then>
    <f:else>
      <input type="hidden" name="redirect_url" value="/index.php?id=X"/>
    </f:else>
  </f:if>