Browse Source

Add role field to returned data

master
Alfred 1 year ago
parent
commit
b7d265c1ee
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      controllers/user.py

+ 2
- 1
controllers/user.py View File

@@ -30,7 +30,8 @@ def login(application):
30 30
             token = jwt.encode({
31 31
                 'username': jdata['username'],
32 32
                 'uid': user.uid,
33
-                'timestamp': str(new_timestamp)
33
+                'timestamp': str(new_timestamp),
34
+                'role': jdata['username']
34 35
             }, _app.secret, algorithm='HS256')
35 36
             return jsonify({'token': token.decode('utf-8')}), 200
36 37
         return '', 403

Loading…
Cancel
Save