Node.js route redirects going to content page

I’m trying to implement security on a node.js site. I’m having an issue where routing to/from the login page isn’t working properly.

My login form looks like this…

 <form id="form_login" method="post" is="dmx-serverconnect-form" action="/api/Security/login" dmx-on:success="browser1.goto('/',true)" dmx-on:unauthorized="browser1.alert(&quot;Wrong login details&quot;)">

But it redirects to the content page index without the layout page. Refreshing the browser loads it properly.

Similarly, my logout button actually logs the user out, but doesn’t redirect to login. A refresh of the browser sends the user to the login page.

Any ideas what could be causing this? Routing works otherwise as far as I can tell. I have buttons that load various parts of the app and they work.

it should be dmx-on:success="browser1.goto('/')" if the route is not internal and you want to load a new layout page.

Do you have the content page defined inside your routes?
CleanShot 2023-02-12 at 20.35.09

And do you have the layout page defined in the Wappler included on the content page?

<!-- Wappler include head-page="layouts/home" -->

Thanks! Removing true from the browser goto fixed the issue when logging in.

I do have the content page defined in my routes…

and the layout page is defined in my content page…

<!-- Wappler include head-page="layouts/login" fontawesome_5="cdn" bootstrap5="local" is="dmx-app" id="login" appConnect="local" -->