There is no client_check in the web2py code base. Maybe that was a proposal
to prevent sharing a session token. Do not remember.
It is easy todo anyway. Try:
auth.settings.extra_fields['auth_user'] = [Field('last_login', 'datetime')]
auth.settings.login_onvalidation.append(lambda form:
db(db.auth_user.email==form.vars['email'])(db.auth_user.last_login<request.now-datetime.timedelta(15)).count()
and form.errors.update({'email', 'already logged in more than 15 mins
ago'}))
auth.settings.login_onaccept.append(lambda form:
db(db..auth_user.id==form.user['id']).update(last_login=request.now)
auth.settings.logout_onlogout = lambda user:
db(db..auth_user.id==user['id']).update(last_login=None)
On Monday, 30 September 2019 02:12:13 UTC-7, Accessorize Withwah wrote:
>
> Is there a way to prevent a user from logging into my application multiple
> times maybe using different devices or from different locations?
> I came across some information somewhere that one could use*
> check_client=True*, I'm just not sure how it works & if it can help me
> achieve my task.
>
> Thank you
>
> WaH
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/web2py/c962ceee-d2d2-4bd3-81d2-09dd93056d97%40googlegroups.com.