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?
It is an example that they gave me
What I really need is what it says in the title.
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.
good day TIMAI2
here is the problem
Autenticar en un solo dispositivo o móvil - #54 por elmachi130
I get this message when I add a text field for email and password, everything else is like the example you sent
That is not in my solution. See @ABG's advice on where you are going wrong. The firebase request appears to be returning correctly.
In publication 44 is the file
I have been guided by that
I ran it again and the same message also appears.
I don't know if it has to do with the rules that changed until last year, which was
and now it is
I don't think so but it rules out all options.
What value is in your status tag?
What is in your responseContent ?
Just noticed, you are using separate if statements instead of one continuous if/elseif/elseif, as in my solution...
your blocks
my blocks
Probably breaking the logic.
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)
I note that your timestamp is:
perfect
how a 0 can change things
one last question
How could I assign an expiration time to the labels?
"first and second" containing (usus)
FB
these are my rules:
{
"rules": {
".read": "now < 1767157200000", // 2025-12-31
".write": "now < 1767157200000", // 2025-12-31
}
}
For example
primero
1767157200000", // 2025-12-31
segundo
1756080000000", // 2025-08-25
Your rules have nothing to do with the timestamps.
Yes I know but I would like to give a time frame, for example only to:
primero
without affecting
segundo
Is it possible?
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.
something like this firebase rules
limit time to tags
Sorry for the question, maybe it's something unusual.
but it's worth asking
You would need a different node (tag or bucket) for each of those rules:
{
"rules": {
"primero": {
".read": now < 1767157200000,
".write": now < 1767157200000
},
"segundo": {
".read": now < 17560800000,
".write": now < 17560800000
}
}
}