Page 1 of 1

Verify if user is signed in.

Posted: Mon May 05, 2014 2:41 pm
by Ryan Tusing

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!


Verify if user is signed in.

Posted: Mon May 05, 2014 4:40 pm
by Kateryna Grynko

Hi Ryan,

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


Verify if user is signed in.

Posted: Mon May 05, 2014 4:47 pm
by Ryan Tusing

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.


Verify if user is signed in.

Posted: Mon May 05, 2014 6:37 pm
by Serhii Kulibaba

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");
}


Verify if user is signed in.

Posted: Fri Jun 13, 2014 2:00 pm
by romo

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


Verify if user is signed in.

Posted: Fri Jun 13, 2014 4:24 pm
by Evgene Karachevtsev

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


Verify if user is signed in.

Posted: Sat Jun 14, 2014 11:34 am
by romo

fantastic. work!

many thanx.