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!
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!
Hi Ryan,
We have a good tutorial that can help you:
http://docs.appery.io/tutorials/build...
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.
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");
}
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)
But all did not work!
User signed still go to Home_Public as a start page. So Plz help me.
regards
Romo
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
fantastic. work!
many thanx.