Mobile app page flow security

I am using a bootstrap mobile frontend and a web backend with security. Trying to figure out why my page will not redirecting page flow. I followed these instructions https://www.youtube.com/watch?v=3YwGbN81Qws
The if condition step is not working. “if identity == false” The page will redirect without the if statement. the identity (false) is returning to the page so I know their server is working. Really struggling with this.

<section>

  <script is="dmx-flow" id="flow12" type="text/dmx-flow" autorun="true">{
  condition: {
    if: "{{(view1.users.data.identity == false)}}",
    then: {
      steps: {
        run: {
          action: "{{browser1.goto('/index.html#!/login',true)}}",
          output: false,
          outputType: "text"
        }
      }
    },
    outputType: "boolean"
  }
}</script>
  <div class="container-fluid">
    <div class="row">
      <div class="col">
        <h2>Admin Page</h2>
        Identity = {{view1.users.data.identity}}<br>
      </div>
    </div>
  </div>
</section>

I do this slightly differently. There’s no need for a Flow, you can use the Dynamic Events in the Server Connect that validates if the user is logged in. If “unauthorized” or “error”, then perform your browser.goto.

1 Like

That doesn’t work either. I did try that as well. Seems to be a bug. I even tried just putting a simple alert if identity == false, and this doesn’t work either even though it is clearly returning false. I do not get any message.

<script is="dmx-flow" id="flow122" type="text/dmx-flow" autorun="true">{
  condition: {
    if: "{{(view1.users.data.identity == false)}}",
    then: {
      steps: {
        bootbox.alert: {message: "unauthorized"}
      }
    },
    outputType: "boolean"
  }
}</script>

<section>

  <div class="container-fluid">
    <div class="row">
      <div class="col">
        <h2>Admin Page</h2>
        Identity = {{view1.users.data.identity}}<br>
      </div>
    </div>
  </div>
</section>

Thinking loud here

Maybe is a timing issue, the flow runs before the sc loads the result as I see you have autorun on

Can you turn off autorun and calling it by the ready event of the app?
Or, with a button to test the logic?

Well I found this:

Don’t know if it’s related and if it has been fixed

You’re correct in that it’s buggy. I cannot find one of the tutorials that work as described. I also have an issue on a M2 Mac running Android. Just doesn’t work after days of troubleshooting. iOS works as advertised. Android works ok on a PC, but now developing on 2 machines. Very frustrating.

Tried turning off autorun and ready event. Same problem. The redirect works fine without the if statement. I have tried simply doing an if statement in page flow to just alert and it does not work. Autorun or not.

After more troubleshooting. The problem appears to be that page flow condition is not picking up the identity value from the server connect. Server connect is returning the identity to the page.

reporting this bug. If there is a workaround please let us know.

Did you add a Server Connect directly to the page and not within a Flow? I use this on my Capacitor app to validate the user is logged in, and redirect if they are not, without any issues.

Here’s a short video showing the process and setup.

Tried that. does not work. Mobile bootstrap app from template. only 2 pages made for testing. It appears in the mobile app it does not get the value from the server connect. works fine on a regular site. The server connect identity value does return if I put the identity value on the page itself so I know the backend works.