flask init-cache

This commit is contained in:
pycook
2019-11-11 15:46:57 +08:00
parent 5f2a0d1a7b
commit 173c120b64
7 changed files with 18 additions and 10 deletions

View File

@@ -1,6 +1,8 @@
# -*- coding:utf-8 -*-
from __future__ import unicode_literals
from functools import wraps
import jwt
@@ -20,7 +22,7 @@ def _auth_with_key():
secret = request.values.get('_secret')
path = request.path
keys = sorted(request.values.keys())
req_args = [request.values[k] for k in keys if str(k) not in ("_key", "_secret")]
req_args = [request.values[k] for k in keys if k not in ("_key", "_secret")]
user, authenticated = User.query.authenticate_with_key(key, secret, req_args, path)
if user and authenticated:
login_user(user)