Add support for client-side session timeout warning

This commit is contained in:
Lance Edgar 2017-02-16 13:32:20 -06:00
parent 4ae70de339
commit e3ec3be03b
4 changed files with 81 additions and 18 deletions

View file

@ -149,6 +149,12 @@ class AuthenticationView(View):
def mobile_logout(self):
return self.logout(mobile=True)
def noop(self):
"""
View to serve as "no-op" / ping action to reset current user's session timer
"""
return {'status': 'ok'}
def change_password(self):
"""
Allows a user to change his or her password.
@ -201,6 +207,10 @@ class AuthenticationView(View):
config.add_route('mobile.logout', '/mobile/logout')
config.add_view(cls, attr='mobile_logout', route_name='mobile.logout')
# no-op
config.add_route('noop', '/noop')
config.add_view(cls, attr='noop', route_name='noop', renderer='json')
# change password
config.add_route('change_password', '/change-password')
config.add_view(cls, attr='change_password', route_name='change_password', renderer='/change_password.mako')