fbSingleSignIn_Timestamp_blank.aia (5.0 KB)
From what I see, it necessarily has to exist.
usus
with the UID tag with a minimum value of 0 so that it does not send the null message
like this
Why are you trying to send a null
as a value, this is not in my blocks ?
I didn't send anything
I just mean that on the Firebase it has to be as follows
when starting for the first time
If not, you get an error
OK, I had not accounted for there being no timestamp there in the first place, also updated the signout routine, so user can only sign out if they are signed in
I will update the blocks above...
fbSingleSignIn_Timestamp_blank2.aia (5.6 KB)
[edit] there is still a bit missing, to allow the signed in user to refresh their token if they are signed in. I will work on that.
When I log in I need to go to screen2
once managed screen2
return to screen1 to log out but with the btSignin button disabled
What should I bring with tinydb to be able to close the session returning from screen2?
Look at the SignOut blocks
You will need the uid
and the idToken
, stored to tinydb, on Screen2. Just copy the SignOut blocks to Screen2 and get the values from tinydb there.
Use a start value, e.g. true/false and test for this on Screen1: if true then SignIn button enabled (the default), else SIgnIn button not enabled.
Here is a blank aia with a refresh button, so that the user can keep the session alive, as long as their existing session has not passed the hour.
You could add a clock to monitor the signin time and either automatically refresh, or alert the user that they need to do so to remain signed in, and to prevent them from signing in on another device
fbSingleSignIn_Timestamp_Refresh_blank.aia (6.9 KB)
Be aware that the keys for the idToken and refreshToken are different in the Signin json and in the Refresh json.
SignIn keys returned are: idToken
& refreshToken
Refresh keys returned are: id_token
& refresh_token
This is reflected in the blocks...
1 I managed to log out from screen2
OK
2 no one can log in while on screen2
OK
3 suppose that while on screen2 the power goes out or the app turns off
procedure:
When I start screen2 I save in TinyDB (idToken and uid) then the power goes out.....
I turn on app
When I start screen1 I get these two data saved in the mobile's TinyDB and the time is automatically updated
and this happens:
Mobile 1
I turn on the app, log in and enter screen2
OK
Mobile 2
I turn on the app, log in and also enter screen2
This means that when I start screen1 the restriction is removed
What could I do?
We could play "what if I did this?" forever.
You will need to work out your own logic handling for such scenarios.
My blocks assume that the user will need to make a signin attempt first, before doing anything else, not an uncontrolled signout. If they can't signin, then they can't signout...
I think I have it
create a value (active) when starting screen2
when it turns off and I start again on screen1 I look for (active) the tinyDB I update time and then I clean it tinyDB
This works for the cell phone where it turned off
but it seems like I'm missing something
what do you think?
new131224.aia (8.4 KB)
as I said:
TIMAI2
Ask why I get this message?
implement
a text field for email
a text field for password
and I tried to order (global action) to understand it better by step
attached file
blocks
new_07012025.aia (9.7 KB)
Verify Password? Is this a different question for a different topic ?
It is the same project only I added a text field for email and password
The error is that you are comparing milliseconds (a big number) against the JSON responseContent.
You did not try to extract the part that holds the time value you want, you just shoved the entire responseContent down the mouth of the poor little math compare (<) block, which was just expecting a couple of numbers.
That's why it gagged.
what would be the solution?
because this does not happen to me when I put the email and password in a text variable
This way the message does not appear
In case you did not notice, I circled in red the location of the bad code.
No, it means you have to learn to read error messages.
The error message showed the two sides of the < comparison.
It is at Authenticate on a single mobile or device - #54 by elmachi130 in case you forgot.
The left side has a time in milliseconds.
The right side has a big long piece of JSON text.
Worse, none of the values in that JSON have enough digits to be a milliseconds value.
So your problem is,
What are you trying to compare against the circled milliseconds value, and why are you doing that comparison?