Fix - Issue #146
This commit is contained in:
parent
675855c73b
commit
6687473931
|
@ -96,9 +96,11 @@ class AppValues(object):
|
|||
def on_get(self, req, resp, table):
|
||||
values = req.params
|
||||
session = req.env['beaker.session']
|
||||
|
||||
print ('\nVALUES', session)
|
||||
if not 'userobj' in session:
|
||||
print (1)
|
||||
session.invalidate()
|
||||
print (2)
|
||||
raise falcon.HTTPTemporaryRedirect('/')
|
||||
|
||||
if table == 'admin':
|
||||
|
|
|
@ -36,6 +36,7 @@ class AuthMiddleware(object):
|
|||
session = req.env['beaker.session']
|
||||
user = session.get('userobj', None)
|
||||
id_session = req.cookies.get('beaker.session.id', '')
|
||||
|
||||
if req.path == '/empresas' or req.path == '/values/empresas':
|
||||
if MV:
|
||||
pass
|
||||
|
@ -48,6 +49,10 @@ class AuthMiddleware(object):
|
|||
raise falcon.HTTPTemporaryRedirect('/main')
|
||||
elif not id_session and req.path != '/':
|
||||
raise falcon.HTTPTemporaryRedirect('/')
|
||||
elif id_session and user is None:
|
||||
session.delete()
|
||||
if req.path == '/main':
|
||||
raise falcon.HTTPTemporaryRedirect('/')
|
||||
|
||||
|
||||
class JSONTranslator(object):
|
||||
|
|
Loading…
Reference in New Issue