8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5fbc910 commit 97e91a3Copy full SHA for 97e91a3
section4/video_code/app.py
@@ -2,7 +2,7 @@
2
3
from flask import Flask, jsonify
4
from flask_restful import Api
5
-import flask_jwt
+from flask_jwt import JWT, JWTError
6
7
from security import authenticate, identity
8
from resources.user import UserRegister
@@ -19,7 +19,7 @@
19
app.secret_key = 'jose'
20
api = Api(app)
21
22
-jwt = flask_jwt.JWT(app, authenticate, identity) # /auth
+jwt = JWT(app, authenticate, identity) # /auth
23
24
api.add_resource(Store, '/store/<string:name>')
25
api.add_resource(Item, '/item/<string:name>')
@@ -29,7 +29,7 @@
29
api.add_resource(UserRegister, '/register')
30
31
32
-@app.errorhandler(flask_jwt.JWTError)
+@app.errorhandler(JWTError)
33
def auth_error(err):
34
return jsonify({'message': 'Could not authorize. Did you include a valid Authorization header?'}), 401
35
0 commit comments