Log In Page to Home Page Setup

Following the Views Walktrough: https://docs.losant.com/experiences/walkthrough/views/overview/

Completed the page layout, login page and home page sections in the example
When testing the login page I am unable to login with an experience user to the home page.

Testing of the login page is done by using the login page content in my domain

Note: imported the endpoint-login.flow

Please assist and thank you for your time

Hi @tirosh_gutte,

When, you log in, it’s triggering an experience workflow. In your workflow that’s handling the /login POST, do you see anything there?

When I login it seems there is some activity that follow this trigger.

Any guidelines on how to troubleshoot this?
If the request was found, why didn’t it forward me to the Home Page?
Why did it stop after 7 requests?

Thank you for your assistance

To expand on this I accumulated the following questions:

  1. (Page Layout) Used the GitHub content but could not have the Log In to appear instead of the {{component “userIndicator”}}
    image
    How can I Use Handlebars to reference the context passed down to the login component?

  2. (Log In Page):
    2.1 In the errorAlert component do I need to change the {{.}} handlebar?
    2.2 In the Endpoint-login.flow workflow the following was setup:
    POST/login --> Endpoint Method/Route: POST/login
    GET/login --> Endpoint Method/Route: GET/login
    2.2.1 What is the expression I should use in the “Logged in?” Logic? Where can I find/ establish this expression?
    2.2.2 What is the expression I should use in the “POST request?” Logic? Where can I find/ establish this expression?

  3. (Home Page):
    3.1 What should be the route (under Method/Route) that will be returning the Home Page? Does having “GET/” represent that route?
    3.2 Under UNAUTHORIZED REPLY TYPE, reply type was chosen as No Static Reply, under REPLY TYPE, Reply Type chosen was No Static Reply (use experience workflow to reply). No experience workflow was set for the GET/ please confirm no workflow is needed.

  4. My Experience User is setup and defined with a password. Using these credentials trough the login page, the home page was not populated, login page reloaded instead.

Appreciate your time on this.

Hi @tirosh_gutte,

I took a look at your experience and it looks as though your Endpoint GET / workflow is disabled, and there is no route or method set in the Endpoint Trigger. This workflow is the logic when you arrive at the homepage of your experience (https://XXXXXXXX.onlosant.com/), and since the workflow is disabled, your page is not being rendered. Let’s get to some of your questions:

  1. I’m not sure I understand this question, could you expand a bit further? Data passed from the workflow to your experience in the Endpoint Reply Node can be accessed at {{pageData}}, more documentation can be found here.

  2. I think a lot of these questions will be answered once you are able to load the login page, you should not have to change any components for the login page. This errorAlert component shows error when there are invalid credentials, it is written for you already! :smile:

2.2.1/2.2.2 the logic already exists in the “Logged In?” and “POST request?” nodes, the expressions are written in the nodes. You do not have to change anything here.

  1. I noticed in your Endpoints that you have GET / set to “authenticated users,” however, your “Unauthorized Reply Type” is set to “No Static Reply.” This means that anyone who is not logged in will see nothing, I think you want to reroute them to the login page, you would do so like so:

  1. Since your Home Page workflow is disabled (Endpoint GET /), you were returned to the page you began. If you enable this workflow, this should not happen.

Thanks!
Julia

1 Like

As always Thank you for your detailed answers.

I enabled the Endpoint GET / workflow and placed a Method/Route in the Endpoint Trigger: GET/login

At the endpoint reply of the GET / Workflow I set the reply type to the experience page with the Home Page ID template.

At Endpoint I set the GET / to Any authenticated user and my unauthorized reply type is set to Redirect with the Redirect Path Template set to /login

Regarding the rest of the questions/answers:

  1. I am able to load my login page in my domain but not from the Page Layout. I simply load the login page context to my domain and try to login this way. The question is how to create the login page link in my Page Layout? I think it should be populated by using the {{component “userIndicator”}} handelbar that call the component userIndicator. Perhaps the component setting is missing something?

  1. Understood, Thank you

  2. Accommodated.

Please let me know if this methodology lack any steps in achieving the goal of populating the Home Page after the the experience user is authenticated. So far my experience user/password is not accepted and the login page is the only page I see once pressing “Sign In” in the loaded login page at my domain:
image

Note: My experience users are unassigned to any group and they never logged in. When I try to login with the users name and password I am receiving the following message: “Incorrect email, password, or two factor code”

Hi @tirosh_gutte,

I do see the issue you are referring to. This is happening because you have two experience workflows with the same Endpoint Triggers:


Changing the second workflow from GET /login to GET / should solve this problem.

Once that is fixed, you will be able to see if your sign in issue was also caused by the Endpoint triggers. If you are still unable to login, please let me know and I will look again!

Thanks,
Julia

Thank you for the reply. I have changed the GET/login to GET/ as you indicated (on the second workflow)

Unfortunately, my experience user/password is not accepted and the login page is the only page I see once pressing “Sign In” in the loaded login page at my domain.

Will try any additional steps you can guide me trough

Note: My experience users are unassigned to any group and they never logged in. When I try to login with the users name and password I am receiving the following message: “Incorrect email, password, or two factor code”

Hi @tirosh_gutte,

I looked at your experience and I don’t see anything obvious. I would recommend debugging on your end by creating a new user and password, and logging in with those credentials. While doing so, you should watch your GET /login and GET / workflows to see the debug logs. The debug logs will likely give some more information as to why you can’t log in, be it a wrong password or path.

Thanks!
Julia

Understood, I appreciate your guidance.

I created a new experience user following: https://docs.losant.com/experiences/users/
Could not login to: https://accounts.losant.com/signin?

Received the following message:
image

Tried logging trough the login PAGE (in my domain) while looking at the GET/login and GET/ workflows but the debug was kept vacant on both workflows:
image

Please note that out of 7 requests today 4 had a 200 status code. This was prior to my trials with the login PAGE.

Any additional debugging recommendations will be appreciated

Hi @tirosh_gutte,

There is a difference between an Experience user and a Losant user. The users you have created are Experience users, who can only log in to your experience. These users do not have individual Losant accounts, so they will not be able to log in to losant.com, and the “Incorrect email, password, or two factor code” error from Losant is correct in this case.

You should see something in your debug if you are able to load the login page. This is the debug when I visited your experience login page:


When I put in incorrect credentials, the page is reloaded and I can see what happened in the debug:


If your debug remained empty for both of these actions, I would expect that the page wasn’t loaded at all. I would try to replicate this, but actually put in successful credentials, and see what you get in the debug.

Thanks!
Julia

Understood, thank you for this clarification

When the login page is uploaded to my domain the debug process is as described in my last reply.

When I run the login page from xxxxx.onlosant.com/login it function correctly like you describe and the home page is populated once the experienced user credentials are loged in with.

The Domain I tried the login page on did not present the same functionality as xxxxx.onlosant.com/login
Any guidance on how to properly use the login page within domains externally to xxxxx.onlosant.com?

Hi @tirosh_gutte,

It sounds like you may be looking to configure an Experience domain, documentation can be found here.

Thanks!
Julia

Thank you for this answer, please confirm that without a paid account with Losant I will not be able to add my Domain:

If these is a way to gain this for the pilot it will help. For now I am forwarding my domain to the slug.

Yes @tirosh_gutte, this is correct.

Experience domains are only available within applications owned by an organization. If you require a fully custom domain in front of your experience endpoints for one of your Sandbox applications, you will need to migrate that application to an organization. - docs