So I’m making an app (obviously), and I’m quite new to Thunkable. I have managed to set up a login page using firebase and that’s all working ok, but I want to have a screen that you can only access if you’re logged in, while also having it in the menu. That’s a bit complicated: basically, a page in the menu that if you’re not logged in, it sends you to the login page and if you are logged in, it lets you go through to the page. I had a go at it by myself, and couldn’t work it out and couldn’t find any tutorials online. Is it even possible?
Welcome to our Community.
Congratulations on your app!
This method might help you -
Local_Storagecomponent from the component tree (in Designer area).
In your Login screen, (when the whole process ends, and you navigate the user to
menu) add this block -
Next, In the menu screen, when that button is clicked, check if the user is logged in, and only let in if he/she is.
Hope I helped you!
Thank you very much for your reply, and I tried it out, however for my menu I am using the Drawer Navigator tool and I’m not entirely sure if your method would work with that tool. Here is my code for the login (I did not come up with this, I copied it off this tutorial):
I see, you have stored the
userID as value,
Whereas I suggested to store
So, try storing true, and then check it
This quick fix works very well, thank you! However another problem has arisen, when you arrive on the login page, and then login, for a split second you go to the private page, however then you get sent back to the login page.
Glad to know that you have solved some part of your problem
Can you please post your complete blocks of login screen?
@kartik14 Here you go:
And here are the blocks on the other page:
This block, is incorrect - it clearly says, when member page opens, if I am logged in, again open member page.
Do you have a main menu, where all buttons are present? Because, this block should be like -
member page btn pressed, check login, and navigate accordingly.
@kartik14 Got it working! Thank you so much, you’re very helpful :). All I had to do was change the member page opens to member page starts! :))