I need that:
1 (a single user authenticates on a single device)
and if you try to log in on another device with the same email and password the message will be (You have already logged in on another device)
2 (if the power goes out or the phone turns off and the app closes without logging out while it is active)
When I restart, it updates the token and allows me to log back in only on this device since I save the UID, URL and token in the mobile's TinyDB.
From what I understand, the token changes every hour, which is why they modified the date in milliseconds.
and the power outage sometimes lasts more than an hour, that's why if I keep the start token it won't do the same thing again after more than an hour and I won't be able to log in again.
Also I noticed I made a data entry error for setting times adding an extra 0 to 3600000 (1 hour). I have updated my original post. (Should not cause a huge issue just 10 hours instead of 1)
What are you talking about, your secure rules or your app ?
[edit]
I have just read your previous post again. Each timestamp relates to a different user, so it make no sense to try and order the timings under usus.
I have 2 users, one in Gmail and the other in Hotmail, both with the same password.
everything runs well in the registration, entry to (screen2) everything ok.
but sometimes this message appears. I realized that this only happens when logging in.
I repeat this is rarely, not always.
That number is the system time and the response content is that JSON string... as ypu can see yourself, it does not make much sense to compare those 2 values, does it?
I am not sure why you are getting back the timestamp and the siginin data in one go, unless you have modified your blocks from my solution, not setting the action variable correctly or something.
The workflow should be:
User signs in, this returns their idToken and other info. The idToken is then used to to fetch the timestamp, and then to allow/deny access.
Looking at your aia, I see you have not adjusted all your if statements to if/elseif as I suggested
Look at my example, again, and correct your blocks.
Or better still, take a few steps back, start with my example as a base, then carefully, testing at each step, modify to your liking.