How to recognise client, or save device in cookie?

Hello everyone!
I have made an app for my pet hotel. And everything is working good, but I am facing with one problem. We have severals ip cams in our hotel, and we give access to our clients, while their pets are staying in our hotel, approximately about 1-2 weeks. So I have made AirTable database with following information: Name of a cam, Image of a cam, Cam Link and a password. So when client want to see the cam, he choose a cam for data view grid


, then he enters the password
and finally gets access to cameras

But, if he want to see another cam, he need to enter the password again.

How I can give him access for example for 15 minutes. And after the time is up, he will have to enter the password again?


Всем привет!
Вдруг мне попадаться русско говорящие пользователи)))

Опишу проблему и на русском, я сделал приложение для своего отеля для собак. Одна из функций нашего отеля, это предоставление доступа к камерам отеля, на время проживания их питомца. Примерно 1 - 2 недели. Так вот, я сделал базу данных на AirTable, в которой сохранил: имя камеры, фотография камеры, ссылка на камеру и пароль от камер. В самом приложении я сделал пункт доступ к камерам, пользователь выбирает камеру которую он хочет посмотреть, потом вводит пароль от неё и попадёт на страницу с камерой. Так вот вопрос следующий, как определить пользователя, который только что ввел успешний пароль от камеры, чтобы дать ему доступ к камерам на ближайшие 15 минут к примеру, а потом опять запросить у него пароль. Есть идеи?

1 Like

It’s really simple. You can:

Wait 900 seconds (15 minutes) before navigating to the login screen.

or

Set a stored var to “Seconds since 1970” block. Use the “Seconds since 1970” block and do a little math.
if [ (Seconds since 1970) - (TimeVar) ] ≤ 900 Navigate to (LoginScreen)

1 Like

Jonathon, thanks. But you didn’t understand me. So I will show you. Sorry, for my bad English((

2 Likes

I see what you mean.

What you need is a variable, named “AskForPassword?” or something and intialize it to true

Then when the user enters the password, it will set AskForPassword to false and wait 900 seconds.
When the 900 seconds are up, it will set AskForPassword to true

The last thing you need is when the screen loads up, it checks if AskForPassword is true or false.
If it’s true, it will ask for the Password.
If it’s false, it won’t show it.

(Also, your English is fine! :slight_smile:)

2 Likes

I see your logic, thanks! And for my English thanks too !!

So I made the first step:

But I can’t understand how to do the next step… I made somethings like this, but I understand that it is wrong((

1 Like

Try

if AskForPassword = True
do navigate to Password_Screen
else navigate to Screen Cam

Or for the last line of code you could use

else if AskForPassword = False
do navigate to Screen Cam
1 Like

Jonathon, thanks again!!

But o have tried several times, and it work, but only for 1 time((

And after you have entered the correct password at least once, it will always be started up without a password.


1 Like

Copy when LogIn Click.
Remove the else statement and the navigate to Screen Cam.
And remove the part where it sets the AskForPassword from the original code.

Thanks! I made little bit different, but it works!

2 Likes