diff options
Diffstat (limited to 'api/user/status.py')
-rw-r--r-- | api/user/status.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/api/user/status.py b/api/user/status.py index e2895d5..030a4ef 100644 --- a/api/user/status.py +++ b/api/user/status.py @@ -1,21 +1,15 @@ from flask import Blueprint, request from db import cursor, connection -from auth.login_token import token_login +from hierarchy import auth_required import json status = Blueprint('user_status', __name__) @status.route('/status', methods = ['POST']) +@auth_required("user") def index(): data = request.get_json() - status = data.get("status") or "" - token = request.cookies.get("token") or "" - - if not token: return "", 401 - login = token_login(token) or "" - - if not login: return "", 403 if not status: return "", 400 cursor.execute("update users set status = ? where user_id = ?", [status[0:200], login]) |