We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36926
    • 701 Posts
    Hi,

    I've set up the unauthorized page that contain a login snippet. How can I get this to then redirect the user to the page they've just tried to access upon logging in.

    I've tried with the most basic call
    [[!Login]]
    

    But nothing, seems to keep redirecting to the home page.

    Also tried using &redirectToPrior but again it redirect to home page. The user logs in fine.

    Thanks

      • 22019
      • 390 Posts
      Have you set a specific 404 - not found page? By default you can often land on the homepage because it's trying to reach a page that doesn't exist.
        Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
        • 36926
        • 701 Posts
        @odeclas, thanks for the reply. Yeah I have all that working fine.

        I've actually half solved it, it's to do with having another instance of the login within the header. So it's seems to be using the parameters set within that login as apposed to the one in the main page.

        Question is it possible to have multiple instance of the login on the same page.

          • 36926
          • 701 Posts
          Ok i've got round this by using the following for the &

          &loginResourceId=`[[*id:isequalto=`55`:then=`0`:else=`22`]]`
          


          Where 55 is equal to my unauthorised page and 22 is the protected area.
            • 22019
            • 390 Posts
            Perhaps setting
            &actionKey=`somethingotherthanservice`
            - might have solved it, if you have two login calls on the same page. Haven't tried it myself....
              Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
              • 36926
              • 701 Posts
              Hey Odeclas, just tried that and unfortunately doesn't work, i'll have to stick with the filter.

              Thanks