File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
python-flask-rest-api-jwt-auth Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 3
3
from db_conf import mysql
4
4
from flask import jsonify
5
5
from flask_jwt import JWT , jwt_required , current_identity
6
- from werkzeug import generate_password_hash , check_password_hash
6
+ from werkzeug . security import generate_password_hash , check_password_hash
7
7
8
8
class User (object ):
9
9
def __init__ (self , id , username ):
@@ -47,7 +47,7 @@ def identity(payload):
47
47
try :
48
48
conn = mysql .connect ()
49
49
cursor = conn .cursor (pymysql .cursors .DictCursor )
50
- cursor .execute ("SELECT id, username, password FROM user WHERE id=%s" , payload ['identity' ])
50
+ cursor .execute ("SELECT id, username FROM user WHERE id=%s" , payload ['identity' ])
51
51
row = cursor .fetchone ()
52
52
53
53
if row :
@@ -65,4 +65,4 @@ def identity(payload):
65
65
jwt = JWT (app , authenticate , identity )
66
66
67
67
if __name__ == "__main__" :
68
- app .run ()
68
+ app .run ()
You can’t perform that action at this time.
0 commit comments