We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1041
    • 51 Posts
    I have standard Login call with pre and post hooks:

    [[!Login? 
       &preHooks=`preHook.DiscussLogin`
       &postHooks=`postHook.DiscussLogin`
    ]]


    Everething works fine - login, logout and other. But this message appears in the error.log every time I logout:

     [2013-02-26 07:46:32] (ERROR @ /index.php) [Login] Post-Hook errors: Array
    (
        [username] => Incorrect username or password. 
        [postHook.DiscussLogin] =>  
    )
    
    [2013-02-26 07:46:32] (ERROR @ /index.php) [Login] Post-Hook error: Incorrect username or password.


    Anybody have the same error?

    This question has been answered by Alexus. See the first response.

    • discuss.answer
      • 1041
      • 51 Posts
      I solved this issue by editing "lgnLogoutTpl" chunk from simple link:
      <a href="[[+logoutUrl]]" title="[[+actionMsg]]">[[+actionMsg]]</a>

      to form which gives hidden "username" field:
      <form class="form" action="[[+logoutUrl]]" method="post">
      <input type="hidden" name="username" id="username" value="[[+modx.user.username]]" />
      <input type="submit" name="logout" value="[[+actionMsg]]" />
      </form>

      But I believe that "postHook.DiscussLogin" should work without that tricks.

      Did anyone had the same error? If yes - I'll post this issue to Tracker.
        • 41155
        • 13 Posts
        I made a second login-resource called "logout" with
        [[!Login?
            &preHooks=`preHook.DiscussLogin`
        ]]
        (maybe the preHook is needless too).

        And I changed the path in logout-link to this resource in wrapper.tpl

        Erhard
          Weitblick Internetwerkstatt, Germany
          www.weitblick.net