2024-06-02 05:20:01 发布
网友
我已经成功地实现了tokenauth并用它来保护我的RESTWeb服务方法——这是一个很好的方法。在
现在我很难从token-like-ID-访问用户数据,以便在accessed(protected)rest服务方法中使用它。在
有什么想法吗?在
您需要导入current_user,它将反映当前请求的当前身份验证用户。在
current_user
from flask_security import current_user, auth_token_required @app.route('/') @auth_token_required def view(): print current_user.id
您需要导入
current_user
,它将反映当前请求的当前身份验证用户。在相关问题 更多 >
编程相关推荐