Ryan Tusing
Posts: 0
Joined: Mon May 05, 2014 2:41 pm

Verify if user is signed in.

Hi! I am trying to figure how to to make the app verify if a user is currently signed in, when the app is loaded, then navigate to either the sign-in page or the home screen. I am not really sure how to go about doing this.
Thanks in advance!

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Verify if user is signed in.

Hi Ryan,

We have a good tutorial that can help you:
http://docs.appery.io/tutorials/build...

Ryan Tusing
Posts: 0
Joined: Mon May 05, 2014 2:41 pm

Verify if user is signed in.

Hi, I have followed this tutorial already and have a functioning sign in/register section for the app.

My question is, how can I set it up so that the when the app starts, it directs the user to the log in page, if they are not currently logged in. If they are already logged in, it directs them to a different page.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Verify if user is signed in.

Hello Ryan,

Save login result into localStorage and check it on the start page. E.g.

if (localStorage.getItem("logged") == "true"){
Apperyio.navigateTo("userPage");
} else {
Apperyio.navigateTo("loginPage");
}

romo
Posts: 0
Joined: Sat May 10, 2014 9:58 am

Verify if user is signed in.

Hi Sergiy

my question same with Ryan. user singed navigate to different page.

i'm still stuck.

What do you mean " sve login result into LSV" and "check it on start page". and where to put that code.

My start page is Home_Public and my page user signed is Home_Signin.

Here my Home_Public. (i put that code on Home_Public - event: load - Action: JS)

Image

Here my page Sign In / Up
Image

Image

Image

But all did not work!
User signed still go to Home_Public as a start page. So Plz help me.

regards
Romo

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Verify if user is signed in.

Helo Romo,

You should on success event for login_service use this code:

codelocalStorage.setItem("logged", "true"); /code

On success for logout_service use this one:

codelocalStorage.setItem("logged", "false"); /code

romo
Posts: 0
Joined: Sat May 10, 2014 9:58 am

Verify if user is signed in.

fantastic. work!

many thanx.

Return to “Issues”