File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
from flask import Flask , jsonify
4
4
from flask_restful import Api
5
- import flask_jwt
5
+ from flask_jwt import JWT , JWTError
6
6
7
7
from security import authenticate , identity
8
8
from resources .user import UserRegister
19
19
app .secret_key = 'jose'
20
20
api = Api (app )
21
21
22
- jwt = flask_jwt . JWT (app , authenticate , identity ) # /auth
22
+ jwt = JWT (app , authenticate , identity ) # /auth
23
23
24
24
api .add_resource (Store , '/store/<string:name>' )
25
25
api .add_resource (Item , '/item/<string:name>' )
29
29
api .add_resource (UserRegister , '/register' )
30
30
31
31
32
- @app .errorhandler (flask_jwt . JWTError )
32
+ @app .errorhandler (JWTError )
33
33
def auth_error (err ):
34
34
return jsonify ({'message' : 'Could not authorize. Did you include a valid Authorization header?' }), 401
35
35
You can’t perform that action at this time.
0 commit comments