forked from elmau/empresa-libre
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):
|
def on_get(self, req, resp, table):
|
||||||
values = req.params
|
values = req.params
|
||||||
session = req.env['beaker.session']
|
session = req.env['beaker.session']
|
||||||
|
print ('\nVALUES', session)
|
||||||
if not 'userobj' in session:
|
if not 'userobj' in session:
|
||||||
|
print (1)
|
||||||
session.invalidate()
|
session.invalidate()
|
||||||
|
print (2)
|
||||||
raise falcon.HTTPTemporaryRedirect('/')
|
raise falcon.HTTPTemporaryRedirect('/')
|
||||||
|
|
||||||
if table == 'admin':
|
if table == 'admin':
|
||||||
|
|
|
@ -36,6 +36,7 @@ class AuthMiddleware(object):
|
||||||
session = req.env['beaker.session']
|
session = req.env['beaker.session']
|
||||||
user = session.get('userobj', None)
|
user = session.get('userobj', None)
|
||||||
id_session = req.cookies.get('beaker.session.id', '')
|
id_session = req.cookies.get('beaker.session.id', '')
|
||||||
|
|
||||||
if req.path == '/empresas' or req.path == '/values/empresas':
|
if req.path == '/empresas' or req.path == '/values/empresas':
|
||||||
if MV:
|
if MV:
|
||||||
pass
|
pass
|
||||||
|
@ -48,6 +49,10 @@ class AuthMiddleware(object):
|
||||||
raise falcon.HTTPTemporaryRedirect('/main')
|
raise falcon.HTTPTemporaryRedirect('/main')
|
||||||
elif not id_session and req.path != '/':
|
elif not id_session and req.path != '/':
|
||||||
raise falcon.HTTPTemporaryRedirect('/')
|
raise falcon.HTTPTemporaryRedirect('/')
|
||||||
|
elif id_session and user is None:
|
||||||
|
session.delete()
|
||||||
|
if req.path == '/main':
|
||||||
|
raise falcon.HTTPTemporaryRedirect('/')
|
||||||
|
|
||||||
|
|
||||||
class JSONTranslator(object):
|
class JSONTranslator(object):
|
||||||
|
|
Loading…
Reference in New Issue