We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18817 ☆ A M B ☆
    • 205 Posts
    I created two Login pages which lead the user to their respective 'member only' pages. I followed example in the RTFM for Login. It worked. For some reason, now it doesn't.

    When I try to log in, it refreshes but just loads the login page; sans form, and doesn't redirect to the ResourceID I set in the snippet. Suggestions + Additional eyes would be appreciated.

    The Snippet Call
    [[!Login?
     &loginTpl=`lgnLoginTpl`
     &logoutTpl=`lgnLogoutTpl`
     &errTpl=`lgnErrTpl`
     &loginResourceId=`132`
     &logoutResourceId=`1`
    ]]


    ID 132
    Set to the Resource Group 'Members Only' (per the instructions).

    Revolution 2.2.10-pl on MODXCloud

      Sal Baldovinos
      SEO & DIGITAL MARKETING

      ARIEL DIGITAL | Maximize Your Potential
      www.arieldigitalmarketing.com
      • 10378
      • 375 Posts
      Can you post the URL request string?
        Freelancer @bitego http://www.bitego.com
        ---
        GoodNews - one of the most advanced and integrated Group Mailer premium add-ons for MODX Revolution!
        More infos here: http://www.bitego.com/extras/goodnews/
        • 18817 ☆ A M B ☆
        • 205 Posts
        Quote from: gadgetto at Jan 21, 2014, 11:16 AM
        Can you post the URL request string?

        Forgive my ignorance - where would I find that?
          Sal Baldovinos
          SEO & DIGITAL MARKETING

          ARIEL DIGITAL | Maximize Your Potential
          www.arieldigitalmarketing.com
          • 18817 ☆ A M B ☆
          • 205 Posts
          Quote from: gadgetto at Jan 21, 2014, 11:16 AM
          Can you post the URL request string?

          I looked at the Source and found

          <input class="returnUrl" type="hidden" name="returnUrl" value="/logins/mobile-login.html" />

          The chunk itself is: <input class="returnUrl" type="hidden" name="returnUrl" value="[[+request_uri]]" />

          I assumed that the returnUrl would be the ID I set in the Snippet (ID 132)? Why is it no longer sending the user to ID 132? [ed. note: mayhemchaos last edited this post 12 years, 8 months ago.]
            Sal Baldovinos
            SEO & DIGITAL MARKETING

            ARIEL DIGITAL | Maximize Your Potential
            www.arieldigitalmarketing.com
            • 10378
            • 375 Posts
            I meant the URL string you will find in your browsers address line when you try to login.
            e.g. http://www.yourdomain.com/...

            Do you use friendly URLs on your MODX site?
              Freelancer @bitego http://www.bitego.com
              ---
              GoodNews - one of the most advanced and integrated Group Mailer premium add-ons for MODX Revolution!
              More infos here: http://www.bitego.com/extras/goodnews/
              • 10378
              • 375 Posts
              Quote from: mayhemchaos at Jan 21, 2014, 09:23 AM

              When I try to log in, it refreshes but just loads the login page; sans form, and doesn't redirect to the ResourceID I set in the snippet. Suggestions + Additional eyes would be appreciated.

              Are you sure you aren't logged in but only the redirect doesn't work as expected?
                Freelancer @bitego http://www.bitego.com
                ---
                GoodNews - one of the most advanced and integrated Group Mailer premium add-ons for MODX Revolution!
                More infos here: http://www.bitego.com/extras/goodnews/
                • 10378
                • 375 Posts
                Quote from: mayhemchaos at Jan 21, 2014, 11:24 AM
                Quote from: gadgetto at Jan 21, 2014, 11:16 AM
                Can you post the URL request string?

                I looked at the Source and found

                <input class="returnUrl" type="hidden" name="returnUrl" value="/logins/mobile-login.html">

                The chunk itself is: <input class="returnUrl" type="hidden" name="returnUrl" value="[[+request_uri]]">

                I assumed that the returnUrl would be the ID I set in the Snippet (ID 132)? Why is it no longer sending the user to ID 132?

                I think, if you set the value of the input to [[+request_uri]] you will always be redirected to the page where the login form resides and not to Resource with ID 132.
                  Freelancer @bitego http://www.bitego.com
                  ---
                  GoodNews - one of the most advanced and integrated Group Mailer premium add-ons for MODX Revolution!
                  More infos here: http://www.bitego.com/extras/goodnews/
                  • 18817 ☆ A M B ☆
                  • 205 Posts
                  UPDATE:
                  The original URL that our users were used to going to was domain.com/mobile -- here they were met with a JS login form. Since it's now in MODX, I wanted to utilize the Login snippet.

                  In MODXCloud, I set a redirect from /mobile to the login URL /logins/mobile-login.html. I removed the redirect from the server and I'm now able to login IF I go to the login URL. What I hoped would be the case was if the user goes to domain.com/mobile - they are automagically redirected to the respective login URL. Not happening.

                  What am I missing?
                    Sal Baldovinos
                    SEO & DIGITAL MARKETING

                    ARIEL DIGITAL | Maximize Your Potential
                    www.arieldigitalmarketing.com
                    • 10378
                    • 375 Posts
                    Quote from: mayhemchaos at Jan 22, 2014, 09:52 AM
                    UPDATE:
                    The original URL that our users were used to going to was domain.com/mobile -- here they were met with a JS login form. Since it's now in MODX, I wanted to utilize the Login snippet.

                    In MODXCloud, I set a redirect from /mobile to the login URL /logins/mobile-login.html. I removed the redirect from the server and I'm now able to login IF I go to the login URL. What I hoped would be the case was if the user goes to domain.com/mobile - they are automagically redirected to the respective login URL. Not happening.

                    What am I missing?

                    Don't know exactly what you mean, but it seems you first will need a small snippet which redirects your users from yourdomain.com/mobile to the Resource with friendly URL yourdomain.com/logins/mobile-login.html. I think there is a Redirect snippet available in MODX extras.
                    In the Resource mobile-login.html you'll need to place the Login snippet.

                    [[!Login?
                        &loginResourceId=`132`
                        &logoutResourceId=`1`
                    ]]



                    You don't need the following params if you use the default chunks provided with Login add-on:

                    &loginTpl=`lgnLoginTpl`
                    &logoutTpl=`lgnLogoutTpl`
                    &errTpl=`lgnErrTpl`
                    

                      Freelancer @bitego http://www.bitego.com
                      ---
                      GoodNews - one of the most advanced and integrated Group Mailer premium add-ons for MODX Revolution!
                      More infos here: http://www.bitego.com/extras/goodnews/
                      • 18817 ☆ A M B ☆
                      • 205 Posts
                      If a user now goes to /mobile - they get a 404 page. If they login via the login URL (logins/mobile-login.html), then they get to /mobile with no issues.

                      My assumption, again, would be, if a user goes to /mobile, but they're not logged in - it should direct them to the login page, right?
                        Sal Baldovinos
                        SEO & DIGITAL MARKETING

                        ARIEL DIGITAL | Maximize Your Potential
                        www.arieldigitalmarketing.com