From 82c921bb887ac656d0c3c996213633275c3fb432 Mon Sep 17 00:00:00 2001 From: penzai Date: Sun, 16 Feb 2020 18:02:24 +0800 Subject: [PATCH] auth: add user in flask.g when auth by jwt --- cmdb-api/api/lib/perm/auth.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cmdb-api/api/lib/perm/auth.py b/cmdb-api/api/lib/perm/auth.py index 5c5d25f..5020dbf 100644 --- a/cmdb-api/api/lib/perm/auth.py +++ b/cmdb-api/api/lib/perm/auth.py @@ -53,6 +53,7 @@ def _auth_with_token(): return False login_user(user) + g.user = user return True except jwt.ExpiredSignatureError: return False