Change session - Login

Guys,
I created this topic because I couldn’t find a specific title. That way I will explain what I want. In my app I have a login screen, a registration screen and a main menu.
The first time this user performs the access registration, filling in the login screen and password, he will be directed to the registration screen (personal data) and after that to the Main Menu. What I want is when he logs in again he is directed to the Main Menu.
I thought of using a tinydb and a session check.

image

image

The problem I don’t know how to do it and on which screen to put this function. Can someone help me?

Yes, you can save in a tinyDb if is the first time or not but remember that tiny is a local Db so if user changes device or installs again app he losts this information. If your flow is login => data user => main menu , you have to add this control after the login screen .
Here the first question : first login and login will be the same ? Or you want to create two different sections ,one for login and one for first time he will choose the username and password?
Second question : where you store list of users? Instead of use TinyDb you can search in the list users to verify the name. If the name exist, it means that is second time so go directly to main menu, if name doesn’t exist go to data section .

Your tinydb tag are mismatching…

When user login succes,
Store in tinydb with tag (session check) value (yes)

When screen initialise
If Call tinydb with a tag (session check) , value if not found (no) = no
Then tell the user to complete registration
Else direct the user to go to Main menu screen

Guys,
At the request of the Group Administrator I am changing the print of images whose blocks are not from Kodular.

In this model I made for an intro screen.
There are three images referring to the purpose of the app. After that, the login screen opens. If he does not see the access registration, the second time he enters he would already go to the login screen. I don’t know how to do this inside a login screen. Does anyone have an example to give me?

I tried to make one here but I think I’m doing something wrong


Check_Session.aia (5.6 KB)

Guys,
I had opened a ticket: Change Session. This call was answered by two people from the Forum but was blocked by the Administrator because the blocks I used were from another platform.
I apologized but I couldn’t continue with a test I did.
When the user enters for the first time with his login and password, he will go to the registration screen and after registration he will go to the menu screen. What I want is that no second time she enters with login and password it goes straight to the menu screen.
In this small test menu, I created a login screen, a data user screen and a menu screen. I couldn’t proceed because it’s the first time I’ve done it and I didn’t search the forum because I don’t even know what title it would be for.

blocks

blocks (2)

Check_Session (2).aia (6.4 KB)

First ~ I didn’t know Kodular Forums where too “closed” when it comes to other platforms… They are even migrating.

Second ~ Your code is not working because you are opening the screen before executing the Session Check saving

can you explain , what you are trying to do here?
image

this condition will never execute on second click… it will work with first click only. no connection block and the value will never become 3

[EDIT, i understand now]

try like this


Check_Session_1.aia (6.2 KB)

(tested and found working)
But keep in mind, it will not consider whether user completed registartion or not…

If you want the user those who completed the registration only have to bypass the login mean, move the tinydb save tag value block into when user completed the registration successfull…

( no where connected with login)
Check_Session_2.aia (6.8 KB)

this vrsion will skip login only those who have completd login and registartion

1 Like

Guys, I want to thank everyone for helping me. I just made one change. After completing the Data_User, the screen returns to the login. When he logs in he goes straight to the Menu. Now there’s a question. Suppose he uninstalls the app and installs it again. How to prevent it from going to the Data_User?

Check_Session_1.aia (5.9 KB)

In such case you should not save the details in local storage, directly store in online db like fb, gsheet, baserow, AT., etc…

So that when a user try to login you can check the user details is present in db or not. If exists direct him to go to menu else return to reg screen.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.