def login():
"""Authenticate users"""
username = post_get('username')
password = post_get('password')
if not aaa.login(username, password):
return dict(ok=False, msg="Username or password invalid")
if aaa.current_user.role == 'admin':
return dict(
ok=True,
redirect="/admin"
)
else:
return dict(
ok=True,
redirect="/experimenter"
)
评论列表
文章目录