We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 49499
    • 48 Posts
    I cannot seem to get the loginResourceParams property from the Login snippet to work. I have tried passing the example value from the documentation but upon successful login, the URL still has no parameters appended to it.

    [[!Login? 
    	&loginTpl=`login_modal`
    	&errTpl=`login_modal_error_handler`
    	&loginResourceId=`[[*id]]`
    	&loginResourceParams=`{"test":123}`
    `]]


    Ideally, what I want to do is pass all current URL parameters through the Login snippet. So if you visit example.com/?utm_source=Facebook&utm_type=Post&utm_campaign=example_campaign and login, the same parameters would carry over. I plan to write a snippet to output the JSON values for the current URL parameters, however I can't even get &test=123 to work...

    Anyone have any ideas?
      • 22840
      • 1,572 Posts
      Not sure if it will make any difference but try changing the loginResourceId to 0, form the rtfm

      loginResourceId The resource to direct users to on successful login. 0 will redirect to self. Leave out if using the default unauthorized page.

      Also make sure you are testing this whilst not logged into the manager, being logged in there can have funny effects
        • 49499
        • 48 Posts
        Quote from: paulp at Jul 05, 2016, 11:45 AM
        Not sure if it will make any difference but try changing the loginResourceId to 0, form the rtfm

        Hi Paul, setting loginResourceId property to 0 still has the same result... I've also tried omitting that property to no avail.

        Quote from: paulp at Jul 05, 2016, 11:45 AM
        Also make sure you are testing this whilst not logged into the manager, being logged in there can have funny effects

        I wouldn't imagine how this could affect the Login snippet since they are different contexts (and I'm using dummy login info to test the web context) but I logged out of the manager anyway and still received the same result. I'm not sure that it makes a difference but I've also tried clearing cache and destroying all sessions to no avail.

        Any other ideas or suggestions?
          • 49499
          • 48 Posts
          I'm beginning to think this is a bug in the actual Login extra itself. Just to check what was being passed through the script properties, I added a line to /core/components/login/controllers/web/Login.php on Line 337 to log the value of loginResourceParams:

          if (empty($loginResourceParams)) { $this->modx->log(modX::LOG_LEVEL_ERROR,'[Login] $loginResourceParams is empty...'); }


          When I log in, the error log just says:

          [2016-07-05 17:35:37] (ERROR @ /index.php) [Login] $loginResourceParams is empty...


          So the value from the snippet is not being passed at all, or so it seems. I am using the most recent version of Login 1.9.2.