Support Topics Documentation Slack YouTube Blog

App routing

Hello,

Newbie here.
I am trying to re-route a user after successful login.
Everything works fine except the user is not routed to another page(Dashboard).

There are two possibilities here:

  1. the login fails and the page doesn’t handle the error - consider putting the login user block into the try/catch block where you can handle the error

or

  1. the Dashboard page doesn’t exist.

Regards,
Mark

The error is handled, for instance if i enter wrong credentials it shows me an error “Invalid Login or password”. (I have used the login page template from backendless and it kind of handles errors. Do i still need to add the try/catch block ?)
But if i enter correct ones, it shows nothing and it doesn’t open dashboard page.
Dashboard Page exists.

Is there anything i am missing out here.?

Try removing the Page Data block from the Go To Page block. Did you do that to pass some specific data?

Regards,
Mark

Still nothing sir.
i have removed the page Data block.
what might be causing the issue here…

What is your application ID?

Here is my application id
175133AD-84FF-9BBA-FF03-00D315CCB500

Here’s what’s going on: When you run the page and try logging in, you’ll see the following error in the browser console:

This is a clue that some value was not passed incorrectly into the login block. Let’s investigate further and take a look at your data binding for the input fields. Here’s what you have:

Notice the value is bound to the “login form data model”. This means when you get the value in the click event, you should use that data model (instead of Page Data):

Btw, if you select the form itself and click the logic for it:

You will see that it already has ALL the logic for handling the login functionality:

I recommend working with the logic that is already in the form, because right now there will be two login API calls - one in the button’s click event and the other in the form’s submit event.

Regards,
Mark

Thank you very much Mark.
I appreciate alot.
Thanks.

Stannoss.