Skip to content

Commit

Permalink
Added requirements.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
vexy committed Mar 2, 2020
1 parent 9420147 commit 135fed7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions auth-module.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from flask import Flask, jsonify, request, make_response
import jwt
import datetime
from flask import Flask, jsonify, request, make_response
from functools import wraps

# initialize main Flask object
Expand All @@ -10,6 +10,7 @@
# used as part of your authentication strategy
app.config['SECRET_KEY'] = 'some_secret_key'

# protector function wraping other functions
def token_access_required(f):
@wraps(f)
def decorated(*args, **kwargs):
Expand All @@ -35,7 +36,7 @@ def protected():

@app.route('/public')
def unprotected():
return jsonify({'message': 'Anyone can view this!'})
return jsonify({'message': 'This is public domain'})

@app.route('/login')
def login():
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Flask==1.1.1
PyJWT==1.7.1

0 comments on commit 135fed7

Please sign in to comment.