Merge pull request #411 from Rocket1184/hotfix/demo-and-admin-redirect

fix: admin and demo view redirect issue
pull/321/merge
Benoît Latinier 6 years ago committed by GitHub
commit 502747cb75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -843,14 +843,19 @@ class API(object):
return JSON({'text': self.isso.render(data["text"])}, 200)
def demo(self, env, req):
return redirect(get_current_url(env) + '/index.html')
return redirect(
get_current_url(env, strip_querystring=True) + '/index.html'
)
def login(self, env, req):
data = req.form
password = self.isso.conf.get("general", "admin_password")
if data['password'] and data['password'] == password:
response = redirect(get_current_url(
env, host_only=True) + '/admin')
response = redirect(re.sub(
r'/login$',
'/admin',
get_current_url(env, strip_querystring=True)
))
cookie = functools.partial(dump_cookie,
value=self.isso.sign({"logged": True}),
expires=datetime.now() + timedelta(1))

Loading…
Cancel
Save