示例#1
0
文件: views.py 项目: Secaly/mushi
def login():
    try:
        auth_token = parse_auth_token()
        validate_auth_token(auth_token)
        return redirect(url_for('views.index'))
    except AuthenticationError:
        return render_template('login.html', api_root=current_app.config['API_ROOT'])
示例#2
0
文件: __init__.py 项目: Secaly/mushi
 def inject_auth_user():
     token = parse_auth_token()
     if token is None:
         return {}
     return {"auth_user": token.owner}