Skip to content

Commit

Permalink
Remove unnecessary with app_context
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaOndieki committed Jul 5, 2018
1 parent bde4835 commit fb68486
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions ridemyway/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,15 @@ def create_app(config_name):
app.jwt = JWTManager(app)
app.blacklist = set()

with app.app_context():
@app.jwt.token_in_blacklist_loader
def check_if_token_in_blacklist(decrypted_token):
"""
Checks whether the identity of the token is blacklisted
Returns:
True if it's blacklisted, false otherwise
"""
jti = decrypted_token['jti'] # JWT ID
return jti in app.blacklist
@app.jwt.token_in_blacklist_loader
def check_if_token_in_blacklist(decrypted_token):
"""
Checks whether the identity of the token is blacklisted
Returns:
True if it's blacklisted, false otherwise
"""
jti = decrypted_token['jti'] # JWT ID
return jti in app.blacklist

@app.route('/')
def api_docs():
Expand Down

0 comments on commit fb68486

Please sign in to comment.