We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8813
    • 18 Posts
    Hello

    I'm trying to set an autologin page with a token and some other params.
    example

    www.mysite.com/autologin.php?token=007878de78dehue7ed08de7&lg=en

    I need to set it through the modx API not with the Login snippet.

    The solution of Bob gives me 'Notice: Undefined index: returnUrl ... Fatal error: Call to a member function failure() on a non-object'

    $_POST['username'] = $user;
    $_POST['password'] = $pass;
    $_POST['service'] = 'login';
    $_REQUEST['service'] = 'login';
    $scriptProperties['loginResourceId'] = 499; // set to page you want to send them to
     
    $modx->runSnippet('Login', $scriptProperties);



    Any help would be appreciated.

    Thanks