About monaca backend login function
We use Monaca to develop an hybrid app. We use Monaca Backend services to authenticate user.
Is there anyway to have no time limit for auto-login ? In our case, we also have a web portal to modify user’s password (if mobile is stolen for example) so unlimited time for auto login could be a great function. Or maybe can we have more “minutes” to add ?
Another question is about number of current “active” login for a user : is there any limit (no more than 5 devices for example) ? Could we use login on a device and then connect with another and keep firt connection open ?
We can find documentation about backend API, or functionality, but not so much on how they should work…
Thanks for your reply,
@soulard I don’t understand what do you mean with no time limit.
monaca.cloud.User.autoLogin()should do the trick. I don’t know exactly after how long the authentication token expires, but it should not be after a short time.
Regarding the second function, it’s a little bit tricky but probably can be done with
User.getProperties(). You need to add a property like
activeSessionsand manage it’s value everytime the user login/logout.
Thanks for reply.
About autologin time limit, my question was about the parameter that we can adjust in monaca backend settings.
Could we have an unlimited valid period ?
About second question, it was more about monaca backend global settings, rather than my own development : does monaca team limit number of device per user or something like that.
@soulard you can set the maximum number of validity to 525600 minutes, which is the equivalent of one year. I guess it’s enough
Regarding the second feature, it’s not natively available on Monaca and we are not planning to implement it as it would take time and resources (which are actually being used to implement other features) and it’s not usually requested by our users (except you, ofc).
@Andi it seems Monaca UX shows an error if we set 525600 in field. But it seems to save even if it’s marked in red… Maybe it’s normal but maybe not…
@soulard we already know that. It’s not normal but you can actually save. Will submit a bug report about this once more, thank you